@Override
  public ClusterHealth checkCluster() {
    checkState(!nodeInformation.isStandalone(), "Clustering is not enabled");
    checkState(sharedHealthState != null, "HealthState instance can't be null when clustering is enabled");

    Set<NodeHealth> nodeHealths = sharedHealthState.readAll();
    Health health = clusterHealthChecks.stream()
      .map(clusterHealthCheck -> clusterHealthCheck.check(nodeHealths))
      .reduce(Health.GREEN, HealthReducer::merge);
    return new ClusterHealth(health, nodeHealths);
  }
@Test
  public void checkCluster_returns_GREEN_status_if_only_GREEN_statuses_returned_by_ClusterHealthChecks() {
    when(nodeInformation.isStandalone()).thenReturn(false);
    List<Health.Status> statuses = IntStream.range(1, 1 + random.nextInt(20)).mapToObj(i -> GREEN).toList();
    HealthCheckerImpl underTest = newClusterHealthCheckerImpl(statuses.stream());

    assertThat(underTest.checkCluster().getHealth().getStatus())
      .describedAs("%s should have been computed from %s statuses", GREEN, statuses)
      .isEqualTo(GREEN);
  }