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

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

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

        return previous;
    }
Removes the entry for {@code key} if it exists.

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