presto-resource-group-managers/src/main/java/io/prestosql/plugin/resourcegroups/StaticSelector.java/StaticSelector/addNamedGroups
class StaticSelector:    private static void addNamedGroups(Pattern pattern, HashSet<String> variables)
    {
        Matcher matcher = NAMED_GROUPS_PATTERN.matcher(pattern.toString());
        while (matcher.find()) {
            String name = matcher.group(1);
            checkArgument(!variables.contains(name), "Multiple definitions found for variable ${" + name + "}");
            variables.add(name);
        }
    }