@Override
        public void visit(Spatial spatial) {
            AnimControl control = spatial.getControl(AnimControl.class);
            if (control != null) {
                AnimComposer composer = new AnimComposer();
                Skeleton skeleton = control.getSkeleton();
                if (skeleton == null) {
                    //only bone anim for now
                    return;
                }

                Joint[] joints = new Joint[skeleton.getBoneCount()];
                for (int i = 0; i < skeleton.getBoneCount(); i++) {
                    Bone b = skeleton.getBone(i);
                    Joint j = joints[i];
                    if (j == null) {
                        j = fromBone(b);
                        joints[i] = j;
                    }
                    for (Bone bone : b.getChildren()) {
                        int index = skeleton.getBoneIndex(bone);
                        Joint joint = joints[index];
                        if (joint == null) {
                            joint = fromBone(bone);
                        }
                        j.addChild(joint);
                        joints[index] = joint;
                    }
                }

                Armature armature = new Armature(joints);
                armature.saveBindPose();
                armature.saveInitialPose();
                skeletonArmatureMap.put(skeleton, armature);

                List<TransformTrack> tracks = new ArrayList<>();

                for (String animName : control.getAnimationNames()) {
                    tracks.clear();
                    Animation anim = control.getAnim(animName);
                    AnimClip clip = new AnimClip(animName);
                    Joint[] staticJoints = new Joint[joints.length];

                    System.arraycopy(joints, 0, staticJoints, 0, joints.length);
                    for (Track track : anim.getTracks()) {
                        if (track instanceof BoneTrack) {
                            BoneTrack boneTrack = (BoneTrack) track;
                            int index = boneTrack.getTargetBoneIndex();
                            Bone bone = skeleton.getBone(index);
                            Joint joint = joints[index];
                            TransformTrack jointTrack = fromBoneTrack(boneTrack, bone, joint);
                            tracks.add(jointTrack);
                            //this joint is animated let's remove it from the static joints
                            staticJoints[index] = null;
                        }
                        //TODO spatial tracks , Effect tracks, Audio tracks
                    }

                    for (int i = 0; i < staticJoints.length; i++) {
                        padJointTracks(tracks, staticJoints[i]);
                    }

                    clip.setTracks(tracks.toArray(new TransformTrack[tracks.size()]));

                    composer.addAnimClip(clip);
                }
                spatial.removeControl(control);
                spatial.addControl(composer);
            }
        }
A private constructor to inhibit instantiation of this class.
jme3-core/src/main/java/com/jme3/anim/util/AnimMigrationUtils.java