@Override
  public boolean isOperational() {
    if (nodeOperational) {
      return true;
    }

    boolean flag = false;
    try {
      flag = checkOperational();
    } catch (InterruptedException e) {
      LOG.trace("Interrupted while checking ES node is operational", e);
      Thread.currentThread().interrupt();
    } finally {
      if (flag) {
        esConnector.stop();
        nodeOperational = true;
      }
    }
    return nodeOperational;
  }
@Test
  public void isOperational_should_return_false_if_Elasticsearch_status_cannot_be_evaluated() {
    EsConnector esConnector = mock(EsConnector.class);
    when(esConnector.getClusterHealthStatus())
      .thenThrow(new RuntimeException("test"));
    EsManagedProcess underTest = new EsManagedProcess(mock(Process.class), ProcessId.ELASTICSEARCH, esConnector, WAIT_FOR_UP_TIMEOUT);
    assertThat(underTest.isOperational()).isFalse();
  }