public static HostsType healthy(Cluster cluster) {
    LinkedHashSet<String> hostNames = new LinkedHashSet<>();
    for (Host host : cluster.getHosts()) {
      MaintenanceState maintenanceState = host.getMaintenanceState(cluster.getClusterId());
      if (maintenanceState == MaintenanceState.OFF) {
        hostNames.add(host.getHostName());
      }
    }

    return normal(hostNames);
  }
Create an instance with all healthy hosts.
ambari-server/src/main/java/org/apache/ambari/server/stack/HostsType.java