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_call_cluster_stat_api() throws Exception {
    HttpEntity entity = mock(HttpEntity.class);
    when(entity.getContent()).thenReturn(new ByteArrayInputStream(EXAMPLE_CLUSTER_STATS_JSON.getBytes()));

    Response response = mock(Response.class);
    when(response.getEntity()).thenReturn(entity);
    when(restClient.performRequest(argThat(new RawRequestMatcher(
      "GET",
      "/_cluster/stats"))))
      .thenReturn(response);

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