In Map (LinkedHashMap), a key is a unique value. Therefore, whenever you try to put a value for a key, it will either add a new record to the card, or the key already exists, and then replace the old value for this key with a new value.
map.put("existing key", "new value");
Above, the code will replace the existing key value on the map with the new value .
source share