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);
  }
Create an instance with an arbitrary chosen high availability host.
ambari-server/src/main/java/org/apache/ambari/server/stack/HostsType.java