DRAFT
MapPutNoOverwrite
Incorrect
Map.put with an existing key does nothing
Correct
CorrectionHere is what's right.
Here is what's right.
Wrong. The existing entry will be replaced with the new entry.
Map<String,Integer> m = ...;
m.put("Hi", 2);
assert m.get("Hi")==2; // m now maps the key "Hi" to the value 2
m.put("Hi", 30);
assert m.get("Hi")==30; // m now maps the key "Hi" to the value 30
Language
Java