code: public static QueryCache getQueryCache(Cache<?, ?> cache) {
        return SecurityActions.getCacheGlobalComponentRegistry(cache.getAdvancedCache()).getComponent(QueryCache.class);
     }
docs: Returns the optional QueryCache.