private void validateAliases(Collection<Host> hosts) {
        Set<String> aliases = new HashSet<>();
        for (Host host : hosts) {
            if (!host.aliases().isEmpty()) {
                if (host.aliases().isEmpty())
                    throw new IllegalArgumentException("Host '" + host.hostname() + "' must have at least one <alias> tag.");
                for (String alias : host.aliases()) {
                    if (aliases.contains(alias))
                        throw new IllegalArgumentException("Alias '" + alias + "' is used by multiple hosts.");
                    aliases.add(alias);
                }
            }
        }
    }
Throw IllegalArgumentException if host aliases breaks invariants
config-model/src/main/java/com/yahoo/config/model/provision/Hosts.java