class OnHeapCachingTier implements CachingTier<K, V> {

    @Override
    public V get(final K key, final Callable<V> source, final boolean updateStats) {
        if (updateStats) { getObserver.begin(); }
        Object cachedValue = backEnd.get(key);
        if (cachedValue == null) {
            if (updateStats) { getObserver.end(GetOutcome.MISS); }
            Fault<V> f = new Fault<V>(source);
            cachedValue = backEnd.putIfAbsent(key, f);
            if (cachedValue == null) {
                try {
                    V value = f.get();
                    putObserver.begin();
                    if (value == null) {
                        backEnd.remove(key, f);
                    } else if (backEnd.replace(key, f, value)) {
                        putObserver.end(PutOutcome.ADDED);
                    } else {
                      return null;
                    }
                    return value;
                } catch (Throwable e) {
                    backEnd.remove(key, f);
                    if (e instanceof RuntimeException) {
                        throw (RuntimeException)e;
                    } else {
                      throw new CacheException(e);
                    }
                }
            }
        } else {
            if (updateStats) { getObserver.end(GetOutcome.HIT); }
        }

        return getValue(cachedValue);
    }

    public  OnHeapCachingTier(final HeapCacheBackEnd<K, Object> backEnd);

}