V (K key, V value) { processQueue(); RefHashMap.Key<K> softKey = mySoftKeyMap.createKey(key); ValueReference<K, V> reference = new ValueReference<>(softKey, value, myQueue); ValueReference<K,V> oldRef = mySoftKeyMap.putKey(softKey, reference); return com.intellij.reference.SoftReference.dereference(oldRef); }