V (@NotNull K key, V value) { processQueue(); RefHashMap.Key<K> weakKey = myMap.createKey(key); ValueReference<K, V> reference = createValueReference(weakKey, value, myQueue); ValueReference<K,V> oldRef = myMap.putKey(weakKey, reference); return dereference(oldRef); }