@Nullable
    public final V put(@NonNull K key, @NonNull V value) {
        if (key == null || value == null) {
            throw new NullPointerException("key == null || value == null");
        }

        V previous;
        synchronized (this) {
            putCount++;
            size += safeSizeOf(key, value);
            previous = map.put(key, value);
            if (previous != null) {
                size -= safeSizeOf(key, previous);
            }
        }

        if (previous != null) {
            entryRemoved(false, key, previous, value);
        }

        trimToSize(maxSize);
        return previous;
    }
Caches {@code value} for {@code key}. The value is moved to the head of
the queue.

@return the previous value mapped by {@code key}.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/collection/LruCache.java