MapEntry<T> (@NotNull MapEntry<T> entry) { removeEntry(entry.key); int index = getArrayIndex(entry.key); entry.next = myArray[index]; myArray[index] = entry; entry.before = myHeader.before; entry.after = myHeader; entry.before.after = entry; myHeader.before = entry; mySize++; if (mySize <= myCapacity) { return null; } MapEntry<T> eldest = myHeader.after; removeEntry(eldest.key); return eldest; }