code: public static boolean isInstanceRunning(String clusterName, int httpPort)
      {
          Log log = Mockito.mock(Log.class);
          
          try (ElasticsearchClient client = new ElasticsearchClient.Builder()
                  .withLog(log)
                  .withHostname("localhost")
                  .withPort(httpPort)
                  .withSocketTimeout(5000)
                  .build())
          {
              return new Monitor(client, log).isInstanceRunning(clusterName);
          }
      }
docs: Check whether the cluster with the given name exists in the ES running on the given port.
  <br><br>
  This is an expensive method, for it initializes a new ES client.
  @param clusterName the ES cluster name
  @param httpPort the HTTP port to connect to ES
  @return true if the instance is running, false otherwise