public void sortChildrenByRank() {
        if (sortType == SortType.BYRANK) {
            return;
        }
        children = sort(children, Group::compareRank);
        sortType = SortType.BYRANK;
    }
Sorts the children by their rank, if they are not sorted already.
searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java