GetOrgAlternativeNamesFunction implements Function<AffMatchOrganization, List<String>>, Serializable { @Override public List<String> apply(AffMatchOrganization organization) { Preconditions.checkNotNull(organization); return ImmutableList.copyOf(organization.getAlternativeNames()); }  @Override List<String> apply(AffMatchOrganization organization);  }
@Test(expected=NullPointerException.class) public void apply_NULL() { function.apply(null); }
@Test public void apply() { AffMatchOrganization organization = new AffMatchOrganization("ORG1"); organization.addAlternativeName("Mickey Mouse's Cheese Factory"); organization.addAlternativeName("Fabryka Sera Myszki Miki"); List<String> names = function.apply(organization); assertEquals(organization.getAlternativeNames().size(), names.size()); assertEquals(names, organization.getAlternativeNames()); }