@SuppressWarnings("unchecked")
    public <T extends AssetCache> T getCache(Class<T> cacheClass) {
        if (cacheClass == null) {
            return null;
        }

        T cache = (T) classToCacheMap.get(cacheClass);
        if (cache == null) {
            synchronized (classToCacheMap) {
                cache = (T) classToCacheMap.get(cacheClass);
                if (cache == null) {
                    try {
                        cache = cacheClass.getDeclaredConstructor().newInstance();
                        classToCacheMap.put(cacheClass, cache);
                    } catch (InstantiationException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException ex) {
                        throw new IllegalArgumentException("The cache class cannot"
                                + " be created, ensure it has empty constructor", ex);
                    } catch (IllegalAccessException | SecurityException ex) {
                        throw new IllegalArgumentException("The cache class cannot "
                                + "be accessed", ex);
                    }
                }
            }
        }
        return cache;
    }
Returns the AssetLoader registered for the given extension
of the current thread.
@return AssetLoader registered with addLoader.
jme3-core/src/main/java/com/jme3/asset/ImplHandler.java