CsvOrganizationAltNamesDictionaryFactory { public List<Set<String>> createAlternativeNamesDictionary(List<String> classpathCsvResources) throws IOException { List<Set<String>> dictionary = Lists.newArrayList(); for (String resource : classpathCsvResources) { List<Set<String>> dictionaryFromCsv = createAltNamesDictionaryFromCsv(resource); dictionary.addAll(dictionaryFromCsv); } return dictionary; }  List<Set<String>> createAlternativeNamesDictionary(List<String> classpathCsvResources);  }
@Test public void createAlternativeNamesDictionary() throws IOException { List<String> csvFiles = ImmutableList.of( "/eu/dnetlib/iis/wf/affmatching/orgalternativenames/alternative_org_names_1.csv", "/eu/dnetlib/iis/wf/affmatching/orgalternativenames/alternative_org_names_2.csv"); List<Set<String>> dictionary = factory.createAlternativeNamesDictionary(csvFiles); assertEquals(3, dictionary.size()); assertThat(dictionary.get(0), containsInAnyOrder("Uniwersytet im. Adama Mickiewicza w Poznaniu", "Adam Mickiewicz University in Poznań", "Adam Mickiewicz University")); assertThat(dictionary.get(1), containsInAnyOrder("Uniwersytet Jagielloński", "Jagiellonian University")); assertThat(dictionary.get(2), containsInAnyOrder("Sveučilište u Zagrebu", "University of Zagreb")); }