@SuppressWarnings("unchecked")
    private <T> Class<T> objectClass(T object) {
        // This should be 100% allowed without a cast but Java generics
        // is not that smart sometimes.
        // Wrapping it in a method at least isolates the warning suppression
        return (Class<T>)object.getClass();
    }
Internal method to work around a Java generics typing issue by
 isolating the 'bad' case into a method with suppressed warnings.
jme3-core/src/main/java/com/jme3/util/clone/Cloner.java