Java AbstractMap.replace()

Java AbstractMap.replace() is a method in the Java AbstractMap class that replaces the value associated with a specified key if it is already present. If the key is not in the map, the operation does nothing. Introduced in Java 1995 with Java 1.2, replace() is commonly used to update the value of an existing key without inserting new entries, ensuring consistent map content.

https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html