code: public boolean isInstanceRunning(String clusterName)
      {
          boolean result;
          try
          {
              @SuppressWarnings("unchecked")
              Map<String, Object> response = client.get("/", Map.class);
              result = clusterName.equals(response.get("cluster_name"));
          }
          catch (ElasticsearchClientException e)
          {
              // failure is allowed
              result = false;
          }
          
          return result;
      }
docs: Check whether the cluster with the given name exists in the current ES instance.
  @param clusterName the ES cluster name
  @return true if the instance is running, false otherwise