public IndicesStatsResponse indicesStats(String... indices) {
    return execute(() -> {
      Request request = new Request("GET", "/" + (indices.length > 0 ? (String.join(",", indices) + "/") : "") + "_stats");
      request.addParameter("level", "shards");
      Response response = restHighLevelClient.getLowLevelClient().performRequest(request);
      return IndicesStatsResponse.toIndicesStatsResponse(gson.fromJson(EntityUtils.toString(response.getEntity()), JsonObject.class));
    }, () -> computeDetailsAsString(indices));
  }
@Test
  public void should_call_indices_stat_api() throws Exception {
    HttpEntity entity = mock(HttpEntity.class);
    when(entity.getContent()).thenReturn(new ByteArrayInputStream(EXAMPLE_INDICES_STATS_JSON.getBytes()));
    Response response = mock(Response.class);
    when(response.getEntity()).thenReturn(entity);
    when(restClient.performRequest(argThat(new RawRequestMatcher(
      "GET",
      "/_stats"))))
      .thenReturn(response);

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