Difference between InheritableThreadLocal<ConcurrentMap> vs InheritableThreadLocal<OwnCacheStorageEntity>? : I have two implementations of an `InheritableThreadLocal` cache.

    private final InheritableThreadLocal<CacheEntity<T>> cacheMap;

    @Inject
    public RequestCache() {
        this.cacheMap = new InheritableThreadLocal<CacheEntity<T>>() {
            @Override
            protected CacheEntity<T> initialValue() {
                return new CacheEntity<>();
            }
        };
    }

    @Getter
    @Setter
    private class CacheEntity<T> {

        private T value;
    }

and

    private final InheritableThreadLocal<ConcurrentMap<String, T>> cacheMap;

    @Inject
    public RequestCache() {
        this.cacheMap = new InheritableThreadLocal<ConcurrentMap<String, T>>() {
            @Override
            protected ConcurrentMap<String, T> initialValue() {
                return new ConcurrentHashMap<>();
            }
        };
    }

. ConcurrentMap one works, whereas the CacheEntity one does not work, for getting setting. I thought since everything happens on one thread, both would work. Any ideas of problems?