@Test
public void testCollectLanguages() throws Exception {

    // given
    List<RepositoryWrapper> repos = asList( //
            repo("C", 30, "Go", 15, "Java", 4), //
            repo("C", 30, "Go", 15, "Java", 4), //
            repo("Java", 2));
    // when
    List<Language> langs = new ArrayList<>(task.collectLanguages(org(repos)));
    // then
    assertThat(langs, hasSize(3));
    sort(langs, (p1, p2) -> p1.getName().compareTo(p2.getName()));
    assertThat(langs.get(0).getName(), equalTo("C"));
    assertThat(langs.get(0).getProjectsCount(), equalTo(2));
    assertThat(langs.get(0).getPercentage(), equalTo(60));
    assertThat(langs.get(1).getName(), equalTo("Go"));
    assertThat(langs.get(1).getProjectsCount(), equalTo(2));
    assertThat(langs.get(1).getPercentage(), equalTo(30));
    assertThat(langs.get(2).getName(), equalTo("Java"));
    assertThat(langs.get(2).getProjectsCount(), equalTo(3));
    assertThat(langs.get(2).getPercentage(), equalTo(10));
}