private static Map<String, Float> weightMap(int[] biArray,
            float[] bwArray, String[] managerMap) {
        assert biArray.length == 4;
        assert bwArray.length == 4;

        Map<String, Float> weightMap = new HashMap<>(4);
        for (int j = 0; j < 4; ++j) {
            int boneIndex = biArray[j];
            if (boneIndex != -1) {
                String managerName = managerMap[boneIndex];
                if (weightMap.containsKey(managerName)) {
                    float oldWeight = weightMap.get(managerName);
                    float newWeight = oldWeight + bwArray[j];
                    weightMap.put(managerName, newWeight);
                } else {
                    weightMap.put(managerName, bwArray[j]);
                }
            }
        }

        return weightMap;
    }
Tabulate the total bone weight associated with each bone/torso link in a
ragdoll.

@param biArray the array of bone indices (not null, unaffected)
@param bwArray the array of bone weights (not null, unaffected)
@param managerMap a map from bone indices to managing link names (not
null, unaffected)
@return a new map from link names to total weight
jme3-jbullet/src/main/java/com/jme3/bullet/animation/RagUtils.java