class HostsType {

  public static HostsType guessHighAvailability(LinkedHashSet<String> hosts) {
    if (hosts.isEmpty()) {
      throw new IllegalArgumentException("Cannot guess HA, empty hosts.");
    }
    String master = hosts.iterator().next();
    List<String> secondaries = hosts.stream().skip(1).collect(toList());
    return new HostsType(singletonList(new HighAvailabilityHosts(master, secondaries)), hosts);
  }

  private  HostsType(List<HighAvailabilityHosts> highAvailabilityHosts, LinkedHashSet<String> hosts);

}