GroupListBuilder getOrCreateChildList(int tag, boolean ranked) {
            int index = tag + 1; // Add 1 to avoid the dreaded -1 default value.
            if (childLists == null || index >= childLists.length) {
                int minSize = index + 1;
                int reservedSize = ((minSize + (CHILDLIST_SIZE_INCREMENTS - 1))/CHILDLIST_SIZE_INCREMENTS) * CHILDLIST_SIZE_INCREMENTS;
                childLists = (childLists == null)
                        ? new GroupListBuilder[reservedSize]
                        : Arrays.copyOf(childLists, reservedSize);
            }
            GroupListBuilder ret = childLists[index];
            if (ret == null) {
                ret = new GroupListBuilder(resultId.newChildId(childCount), tag, stable, ranked);
                childLists[index] = ret;
                childCount++;
            }
            return ret;
        }
Constructs the grouping result tree that corresponds to the parameters given to this builder. This method might
fail due to unsupported constructs in the results, in which case an exception is thrown.

@throws IllegalInputException Thrown if the grouping result contains unsupported constructs.
container-search/src/main/java/com/yahoo/search/grouping/vespa/ResultBuilder.java