public <T> T javaClone(T object) throws CloneNotSupportedException {
        if (object == null) {
            return null;
        }
        Method m = methodCache.get(object.getClass());
        if (m == null) {
            try {
                // Lookup the method and cache it
                m = object.getClass().getMethod("clone");
            } catch (NoSuchMethodException e) {
                throw new CloneNotSupportedException("No public clone method found for:" + object.getClass());
            }
            methodCache.put(object.getClass(), m);

            // Note: yes we might cache the method twice... but so what?
        }

        try {
            Class<? extends T> type = objectClass(object);
            return type.cast(m.invoke(object));
        } catch (IllegalAccessException | InvocationTargetException e) {
            throw new RuntimeException("Error cloning object of type:" + object.getClass(), e);
        }
    }
Performs a raw shallow Java clone using reflection.  This call does NOT
 check against the clone index and so will return new objects every time
 it is called.  That's because these are shallow clones and have not (and may
 not ever, depending on the caller) get resolved.

 <p>This method is provided as a convenient way for CloneFunctions to call
 clone() and objects without necessarily knowing their real type.</p>

@param <T> the type of object to be cloned
@param object the object to be cloned (may be null)
@return a new instance or null
@throws CloneNotSupportedException if the object has no public clone method
jme3-core/src/main/java/com/jme3/util/clone/Cloner.java