@Override
  public Health check(Set<NodeHealth> nodeHealths) {
    Set<NodeHealth> appNodes = nodeHealths.stream()
      .filter(s -> s.getDetails().getType() == NodeDetails.Type.APPLICATION)
      .collect(Collectors.toSet());

    return Arrays.stream(AppNodeClusterHealthSubChecks.values())
      .map(s -> s.check(appNodes))
      .reduce(Health.GREEN, HealthReducer::merge);
  }
@Test
  public void status_YELLOW_when_one_RED_node_and_one_YELLOW_application_node() {
    Set<NodeHealth> nodeHealths = nodeHealths(RED, YELLOW).collect(toSet());

    Health check = underTest.check(nodeHealths);

    assertThat(check)
      .forInput(nodeHealths)
      .hasStatus(Health.Status.YELLOW)
      .andCauses(
        "At least one application node is RED",
        "At least one application node is YELLOW");
  }