@SuppressWarnings("unchecked")
    protected <T> T registerAndCloneSmartAsset(AssetKey<T> key, T obj, AssetProcessor proc, AssetCache cache) {
        // object obj is the original asset
        // create an instance for user
        if (proc == null) {
            throw new IllegalStateException("Asset implements "
                    + "CloneableSmartAsset but doesn't "
                    + "have processor to handle cloning");
        } else {
            T clone = (T) proc.createClone(obj);
            if (cache != null && clone != obj) {
                cache.registerAssetClone(key, clone);
            } else {
                throw new IllegalStateException("Asset implements "
                        + "CloneableSmartAsset but doesn't have cache or "
                        + "was not cloned");
            }
            return clone;
        }
    }
Clones the asset using the given processor and registers the clone
with the cache.

@param <T> The asset type
@param key The asset key
@param obj The asset to clone / register, must implement
    {@link CloneableSmartAsset}.
@param proc The processor which will generate the clone, cannot be null
@param cache The cache to register the clone with, cannot be null.
@return The cloned asset, cannot be the same as the given asset since
    it is a clone.

@throws IllegalStateException If asset does not implement
{@link CloneableSmartAsset}, if the cache is null, or if the
processor did not clone the asset.
jme3-core/src/main/java/com/jme3/asset/DesktopAssetManager.java