src/main/java/org/jivesoftware/smack/util/Cache.java
public synchronized V remove(Object key, boolean internal) {
        // noinspection SuspiciousMethodCalls
        CacheObject<V> cacheObject = map.remove(key);
        // If the object is not in cache, stop trying to remove it.
        if (cacheObject == null) {
            return null;
        }
        // Remove from the cache order list
        cacheObject.lastAccessedListNode.remove();
        cacheObject.ageListNode.remove();
        // Remove references to linked list nodes
        cacheObject.ageListNode = null;
        cacheObject.lastAccessedListNode = null;

        return cacheObject.object;
    }
public synchronized V remove(Object key, boolean internal) {
        // noinspection SuspiciousMethodCalls
        CacheObject<V> cacheObject = map.remove(key);
        // If the object is not in cache, stop trying to remove it.
        if (cacheObject == null) {
            return null;
        }
        // Remove from the cache order list
        cacheObject.lastAccessedListNode.remove();
        cacheObject.ageListNode.remove();
        // Remove references to linked list nodes
        cacheObject.ageListNode = null;
        cacheObject.lastAccessedListNode = null;

        return cacheObject.object;
    }
/*
Remove operation with a flag so we can tell coherence if the remove was
caused by cache internal processing such as eviction or loading