TreeMap put operation

Map map = new TreeMap();
map.put("test key 1", "test value 1");
map.put("test key 2", "test value 2");
map.put("test key 3", "test value 3");
  
System.out.println(map.put("test key 3", "test value 3"));
System.out.println(map.put("test key 4", "test value 4"));
Option A) System.out.println(map.put(“test key 3”, “test value 3”));
Answer) This prints the output as = test value 3

Option B) System.out.println(map.put(“test key 4”, “test value 4”));
Answer) This prints the output as = null;

If you look at Map.put() operation, it returns the value if key is already present in map.