Joint[] listManagedBones(String managerName) {
        List<Joint> list = new ArrayList<>(8);

        if (torsoName.equals(managerName)) {
            Joint[] roots = skeleton.getRoots();
            for (Joint rootBone : roots) {
                list.add(rootBone);
                addUnlinkedDescendants(rootBone, list);
            }

        } else {
            BoneLink manager = findBoneLink(managerName);
            if (manager == null) {
                String msg = "No link named " + managerName;
                throw new IllegalArgumentException(msg);
            }
            Joint managerBone = manager.getBone();
            list.add(managerBone);
            addUnlinkedDescendants(managerBone, list);
        }
        /*
         * Convert the list to an array.
         */
        int numManagedBones = list.size();
        Joint[] array = new Joint[numManagedBones];
        list.toArray(array);

        return array;
    }
Enumerate all managed bones of the named link, in a pre-order,
depth-first traversal of the skeleton, such that child bones never
precede their ancestors.

@param managerName the name of the managing link (not null)
@return a new array of managed bones, including the manager if it is not
the torso
jme3-jbullet/src/main/java/com/jme3/bullet/animation/DacLinks.java