private void testSort(Material ... materials) {
        GeometryList gl = new GeometryList(comparator);
        for (int g = 0; g < 5; g++) {
            for (int i = materials.length - 1; i >= 0; i--) {
                Geometry geom = new Geometry("geom", mesh);
                Material clonedMaterial = materials[i].clone();
                
                if (materials[i].getActiveTechnique() != null) {
                    String techniqueName = materials[i].getActiveTechnique().getDef().getName();
                    clonedMaterial.selectTechnique(techniqueName, renderManager);
                } else {
                    clonedMaterial.selectTechnique(TechniqueDef.DEFAULT_TECHNIQUE_NAME, renderManager);
                }
                
                geom.setMaterial(clonedMaterial);
                gl.add(geom);
            }
        }
        gl.sort();
        
        for (int i = 0; i < gl.size(); i++) {
            Material mat = gl.get(i).getMaterial();
            String sortId = Integer.toHexString(mat.getSortId()).toUpperCase();
            System.out.print(sortId + "\t");
            System.out.println(mat);
        }
        
        Set<String> alreadySeen = new HashSet<>();
        Material current = null;
        for (int i = 0; i < gl.size(); i++) {
            Material mat = gl.get(i).getMaterial();
            if (current == null) {
                current = mat;
            } else if (!current.getName().equals(mat.getName())) {
                assert !alreadySeen.contains(mat.getName());
                alreadySeen.add(current.getName());
                current = mat;
            }
        }
        
        for (int i = 0; i < materials.length; i++) {
            for (int g = 0; g < 5; g++) {
                int index = i * 5 + g;
                Material mat1 = gl.get(index).getMaterial();
                Material mat2 = materials[i];
                assert mat1.getName().equals(mat2.getName()) : 
                       mat1.getName() + " != " + mat2.getName() + " for index " + index;
            }
        }
    }
Given a correctly sorted list of materials, check if the 
opaque comparator can sort a reversed list of them.

Each material will be cloned so that none of them will be equal to each other
in reference, forcing the comparator to compare the material sort ID.

E.g. for a list of materials A, B, C, the following list will be generated:
<pre>C, B, A, C, B, A, C, B, A</pre>, it should result in
<pre>A, A, A, B, B, B, C, C, C</pre>.

@param materials The pre-sorted list of materials to check sorting for.
jme3-core/src/test/java/com/jme3/renderer/OpaqueComparatorTest.java