AffOrgMatchVotersFactory { public static AffOrgMatchVoter createNameCountryStrictMatchVoter(float matchStrength, Function<AffMatchOrganization, List<String>> getOrgNamesFunction) { NameStrictWithCharFilteringMatchVoter orgNameVoter = new NameStrictWithCharFilteringMatchVoter(ImmutableList.of(',', ';')); orgNameVoter.setGetOrgNamesFunction(getOrgNamesFunction); CompositeMatchVoter voter = new CompositeMatchVoter(ImmutableList.of(new CountryCodeStrictMatchVoter(), orgNameVoter)); voter.setMatchStrength(matchStrength); return voter; } private  AffOrgMatchVotersFactory(); static AffOrgMatchVoter createNameCountryStrictMatchVoter(float matchStrength, Function<AffMatchOrganization, List<String>> getOrgNamesFunction); static AffOrgMatchVoter createNameStrictCountryLooseMatchVoter(float matchStrength, Function<AffMatchOrganization, List<String>> getOrgNamesFunction); static AffOrgMatchVoter createSectionedNameStrictCountryLooseMatchVoter(float matchStrength, Function<AffMatchOrganization, List<String>> getOrgNamesFunction); static AffOrgMatchVoter createSectionedNameLevenshteinCountryLooseMatchVoter(float matchStrength, Function<AffMatchOrganization, List<String>> getOrgNamesFunction);  }
@Test public void createNameCountryStrictMatchVoter() { AffOrgMatchVoter voter = AffOrgMatchVotersFactory.createNameCountryStrictMatchVoter(matchStrength, getOrgNamesFunction); assertEquals(matchStrength, voter.getMatchStrength(), PRECISION); assertTrue(voter instanceof CompositeMatchVoter); assertInternalVotersCount(voter, 2); assertTrue(getInternalVoter(voter, 0) instanceof CountryCodeStrictMatchVoter); assertOrgNameVoter(getInternalVoter(voter, 1), NameStrictWithCharFilteringMatchVoter.class, getOrgNamesFunction); List<Character> charsToFilter = Whitebox.getInternalState(getInternalVoter(voter, 1), "charsToFilter"); assertEquals(ImmutableList.of(',', ';'), charsToFilter); }