MutableMap.replace on the JVM in other languages

Change a room assignment only if it is still current