private Set<String> osFamiliesInCluster(Cluster cluster) {
    return cluster.getHosts().stream()
      .filter(host -> host.getMaintenanceState(cluster.getClusterId()) == OFF)
      .map(Host::getOsFamily)
      .collect(toSet());
  }
@return set of each os family in the cluster, excluding hosts which are in maintenance state
ambari-server/src/main/java/org/apache/ambari/server/checks/MissingOsInRepoVersionCheck.java