code: public boolean contains(Object ob) {
          for( SoftReference<T> ref : cache.values() ) {
              T item = ref.get();
  
              if( item != null && ob.equals(item) ) {
                  if( item instanceof CachedItem ) {
                      if( !((CachedItem)item).isValidForCache() ) {
                          return false;
                      }
                  }
                  return true;
              }
          }
          return false;
      }
docs: Checks the specified object against the cache and verifies that it
  is in the cache. This method will return
  <span class="keyword">false</span> if the object was once in the cache
  but has expired due to inactivity.
  @param ob the object to check for in the cache
  @return true if the object is in the cache