class AbstractCache implements IDataCache<T> {

  @Override
  public boolean dataExists(long id) {
    boolean result = false;
    lock.readLock().lock();
    try {
      if (dataIsInCache(id)) {
        result = true;
      } else {
        result = cachedStorage.dataExists(id);
      }
    } finally {
      lock.readLock().unlock();
    }
    return result;
  }

  public  AbstractCache(S entries, IDataStorage<T> cachedStorage, long maxCacheSize,
      Predicate<T> cachingRule);

}