V (int key, @NotNull V value) { IntReference<V> newRef = createReference(key, value, myQueue); V prev; while (true) { IntReference<V> oldRef = myMap.putIfAbsent(key, newRef); if (oldRef == null) { prev = null; break; } V oldVal = oldRef.get(); if (oldVal == null) { if (myMap.replace(key, oldRef, newRef)) { prev = null; break; } } else { prev = oldVal; break; } processQueue(); } processQueue(); return prev; }