presto-resource-group-managers/src/main/java/io/prestosql/plugin/resourcegroups/AbstractResourceConfigurationManager.java/AbstractResourceConfigurationManager/parentGroupContext
class AbstractResourceConfigurationManager:    @Override
    public SelectionContext<ResourceGroupIdTemplate> parentGroupContext(SelectionContext<ResourceGroupIdTemplate> context)
    {
        ResourceGroupId parentGroupId = context.getResourceGroupId().getParent().orElseThrow(() -> new IllegalArgumentException("Group has no parent group: " + context.getResourceGroupId()));
        List<ResourceGroupNameTemplate> parentGroupIdTemplate = new ArrayList<>(context.getContext().getSegments());
        parentGroupIdTemplate.remove(parentGroupIdTemplate.size() - 1);
        return new SelectionContext<>(parentGroupId, ResourceGroupIdTemplate.fromSegments(parentGroupIdTemplate));
    }