public void setUserData(String key, Object data) {
        if (data == null) {
            if (userData != null) {
                userData.remove(key);
                if (userData.isEmpty()) {
                    userData = null;
                }
            }
        } else {
            if (userData == null) {
                userData = new HashMap<String, Savable>();
            }
            if (data instanceof Savable) {
                userData.put(key, (Savable) data);
            } else {
                userData.put(key, new UserData(UserData.getObjectType(data), data));
            }
        }
    }
Called internally by com.jme3.util.clone.Cloner.  Do not call directly.
jme3-core/src/main/java/com/jme3/scene/Spatial.java