class AbstractCache implements IDataCache<T> {

  @Override
  public T loadData(long id) {
    // Search entry in cache
    T entry = getData(id, true);
    if (entry == null) {
      // No entry in cache found, search in underlying storage
      entry = cachedStorage.loadData(id);
      if (entry == null) {
        return null;
      }
      // Data found, cache it and return
      cacheData(entry);
    }
    return entry;
  }

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

}