public void sortChildrenRecursive(int i) {
        Children children = childTrees.get(i);
        for (SpanNode node : children.children()) {
            if (node instanceof SpanList) {
                ((SpanList) node).sortChildrenRecursive();
            }
        }
        Collections.sort(children.children());
    }
Recursively sorts all children in subtree i by occurrence in the text covered.

@param i the index of the subtree to sort recursively
document/src/main/java/com/yahoo/document/annotation/AlternateSpanList.java