V (K key, @NotNull V value) { Entry<K, V>[] table = this.entries; int hash = hashKey(key); int index = hash & mask; for (Entry<K, V> e = table[index]; e != null; e = e.hashNext) { K entryKey; if (e.keyHash == hash && ((entryKey = e.key) == key || hashingStrategy.isEqual(entryKey, key))) { moveToTop(e); return e.setValue(value); } } Entry<K, V> e = new Entry<>(key, value, hash); e.hashNext = table[index]; table[index] = e; Entry<K, V> top = this.top; e.next = top; if (top != null) { top.previous = e; } else { back = e; } this.top = e; size++; if (removeEldestEntry.check(size, back, back.key, back.value)) { V value1 = remove(back.key); assert value1 != null : "LinkedHashMap.Entry was not removed. Possibly mutable key: " + back.key; } else if (size >= maxFill) { rehash(HashCommon.arraySize(size + 1, LOAD_FACTOR)); } return null; }