Set<String> getUpInstances() {
    Set<String> upInstances = new HashSet<>();
    for (MockHelixAdmin helixAdmin : helixAdmins.values()) {
      upInstances.addAll(helixAdmin.getUpInstances());
    }
    // add cloud datanodes
    dataCenterToZkAddress.values()
        .stream()
        .filter(info -> info.getReplicaType() == ReplicaType.CLOUD_BACKED)
        .forEach(info -> upInstances.add(ClusterMapUtils.getInstanceName(info.getDcName(), DataNodeId.UNKNOWN_PORT)));
    return upInstances;
  }
@return set of all instances that are up in this cluster.
ambry-clustermap/src/test/java/com/github/ambry/clustermap/MockHelixCluster.java