@Override
    public boolean containsValue(final Object value) {
        checkNotNull(value, NULL_VALUE_IS_NOT_ALLOWED);
        // First, clear all entries that have been in cache longer than the
        // maximum defined age.
        deleteExpiredEntries();

        for (final V v : values()) {
            if (value.equals(v)) {
                return true;
            }
        }
        return false;
    }
Create a new default cache and specify the maximum size of for the cache in
bytes, and the maximum lifetime of objects.

@param name a name for the cache.
@param maxSize the maximum size of the cache in bytes. -1 means the cache
     has no max size.
@param maxLifetime the maximum amount of time objects can exist in
     cache before being deleted. -1 means objects never expire.
xmppserver/src/main/java/org/jivesoftware/util/cache/DefaultCache.java