public ProjectMeasuresStatistics searchSupportStatistics() {
    SearchRequest projectMeasuresSearchRequest = buildProjectMeasureSearchRequest();
    SearchResponse projectMeasures = client.search(projectMeasuresSearchRequest);
    return buildProjectMeasuresStatistics(projectMeasures);
  }
@Test
  public void search_statistics() {
    es.putDocuments(TYPE_PROJECT_MEASURES,
      newDoc("lines", 10, "coverage", 80)
        .setLanguages(Arrays.asList("java", "cs", "js"))
        .setNclocLanguageDistributionFromMap(ImmutableMap.of("java", 200, "cs", 250, "js", 50)),
      newDoc("lines", 20, "coverage", 80)
        .setLanguages(Arrays.asList("java", "python", "kotlin"))
        .setNclocLanguageDistributionFromMap(ImmutableMap.of("java", 300, "python", 100, "kotlin", 404)));

    ProjectMeasuresStatistics result = underTest.searchSupportStatistics();

    assertThat(result.getProjectCount()).isEqualTo(2);
    assertThat(result.getProjectCountByLanguage()).containsOnly(
      entry("java", 2L), entry("cs", 1L), entry("js", 1L), entry("python", 1L), entry("kotlin", 1L));
    assertThat(result.getNclocByLanguage()).containsOnly(
      entry("java", 500L), entry("cs", 250L), entry("js", 50L), entry("python", 100L), entry("kotlin", 404L));
  }