public static HostsType from(String master, String secondary, LinkedHashSet<String> hosts) {
    return master == null
      ? normal(hosts)
      : new HostsType(singletonList(new HighAvailabilityHosts(master, secondary != null ? singletonList(secondary) : emptyList())), hosts);

  }
Creates an instance from the optional master and secondary components and with the given host set
ambari-server/src/main/java/org/apache/ambari/server/stack/HostsType.java