public ClusterStatsResponse clusterStats() {
    return execute(() -> {
      Request request = new Request("GET", "/_cluster/stats");
      Response response = restHighLevelClient.getLowLevelClient().performRequest(request);
      return ClusterStatsResponse.toClusterStatsResponse(gson.fromJson(EntityUtils.toString(response.getEntity()), JsonObject.class));
    });
  }
@Test
  public void should_add_authentication_header() throws InterruptedException {
    mockWebServer.enqueue(new MockResponse()
      .setResponseCode(200)
      .setBody(EXAMPLE_CLUSTER_STATS_JSON)
      .setHeader("Content-Type", "application/json"));

    String password = "test-password";
    EsClient underTest = new EsClient(password, null, null, new HttpHost(mockWebServer.getHostName(), mockWebServer.getPort()));

    assertThat(underTest.clusterStats()).isNotNull();

    assertThat(mockWebServer.takeRequest().getHeader("Authorization")).isEqualTo("Basic ZWxhc3RpYzp0ZXN0LXBhc3N3b3Jk");
  }