presto-resource-group-managers/src/main/java/io/prestosql/plugin/resourcegroups/AbstractResourceConfigurationManager.java/AbstractResourceConfigurationManager/validateSelectors
class AbstractResourceConfigurationManager:    private void validateSelectors(List<ResourceGroupSpec> groups, SelectorSpec spec)
    {
        spec.getQueryType().ifPresent(this::validateQueryType);
        StringBuilder fullyQualifiedGroupName = new StringBuilder();
        for (ResourceGroupNameTemplate groupName : spec.getGroup().getSegments()) {
            fullyQualifiedGroupName.append(groupName);
            Optional<ResourceGroupSpec> match = groups
                    .stream()
                    .filter(groupSpec -> groupSpec.getName().equals(groupName))
                    .findFirst();
            if (!match.isPresent()) {
                throw new IllegalArgumentException(format("Selector refers to nonexistent group: %s", fullyQualifiedGroupName.toString()));
            }
            fullyQualifiedGroupName.append(".");
            groups = match.get().getSubGroups();
        }
    }