private List<GroupBuilder> collectSubGroups(boolean isHosted, StorageGroup parentGroup, ModelElement parentGroupElement) {
            List<ModelElement> subGroupElements = parentGroupElement.subElements("group");
            if (subGroupElements.size() > 1 && parentGroup.getPartitions().isEmpty())
                throw new IllegalArgumentException("'distribution' attribute is required with multiple subgroups");

            List<GroupBuilder> subGroups = new ArrayList<>();
            String indexPrefix = "";
            if (parentGroup.index != null) {
                indexPrefix = parentGroup.index + ".";
            }
            for (ModelElement g : subGroupElements) {
                subGroups.add(collectGroup(isHosted, Optional.of(g), Optional.ofNullable(g.child("nodes")), g.stringAttribute("name"),
                                           indexPrefix + g.integerAttribute("distribution-key")));
            }
            return subGroups;
        }
Creates a content group builder from a group and/or nodes element.
These are the possibilities:
<ul>
<li>group and nodes is present: This is a leaf group specifying a set of nodes</li>
<li>only group is present: This is a nonleaf group</li>
<li>only nodes is present: This is the implicitly specified toplevel leaf group, or a set of groups
                           specified using a group count attribute.
<li>Neither element is present: Create a single node.
</ul>

Note: DO NOT change allocation behaviour to allow version X and Y of the config-model to allocate a different
set of nodes. Such changes must be guarded by a common condition (e.g. feature flag) so the behaviour can be
changed simultaneously for all active config models.
config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java