boolean (int key, @NotNull V oldValue, @NotNull V newValue) { boolean replaced = myMap.replace(key, createReference(key, oldValue, myQueue), createReference(key, newValue, myQueue)); processQueue(); return replaced; }