@Override
    public Iterator<Geometry> iterator() {
        return new Iterator<Geometry>() {
            int index = 0;

            @Override
            public boolean hasNext() {
                return index < size();
            }


            @Override
            public Geometry next() {
                if (index >= size()) {
                    throw new NoSuchElementException("Geometry list has only " + size() + " elements");
                }
                return get(index++);
            }

            @Override
            public void remove() {
                throw new UnsupportedOperationException("Geometry list doesn't support iterator removal");
            }
        };
    }
Sorts the elements in the list according to their Comparator.
jme3-core/src/main/java/com/jme3/renderer/queue/GeometryList.java