@Override
  public NodeHealth get() {
    NodeHealth.Builder builder = NodeHealth.newNodeHealthBuilder();
    if (clusterAppState.isOperational(ProcessId.ELASTICSEARCH, true)) {
      builder.setStatus(NodeHealth.Status.GREEN);
    } else {
      builder.setStatus(NodeHealth.Status.RED)
        .addCause("Elasticsearch is not operational");
    }
    return builder
      .setDetails(nodeDetails)
      .build();
  }
@Test
  public void get_returns_started_from_System2_now_at_constructor_time() {
    Properties properties = new Properties();
    long now = setRequiredPropertiesAndMocks(properties);
    SearchNodeHealthProvider underTest = new SearchNodeHealthProvider(new Props(properties), clusterAppState, networkUtils, clock);

    NodeHealth nodeHealth = underTest.get();

    assertThat(nodeHealth.getDetails().getStartedAt()).isEqualTo(now);

    // change now
    when(clock.now()).thenReturn(now);

    NodeHealth newNodeHealth = underTest.get();

    assertThat(newNodeHealth.getDetails().getStartedAt()).isEqualTo(now);
  }