Of course, if k/null exists, then for many of these methods (merge, putIfAbsent, computeIfAbsent etc) then k/null is semantically the same as k does not exist.
Code: Select all
Map m = new HashMap();
m.put(1,null);
m.putIfAbsent(1,10);
System.out.println(m); //{1=10}