replace

fun replace(key: K, oldValue: V, newValue: V): Boolean

Replaces the entry for the specified key only if currently mapped to the specified value and return true if replaced.