FullyQualifiedNamesExtractor implements NamesExtractor { public ImmutableList<String> extractNames(ImmutableList<NamePart> nameParts) { return ImmutableList.copyOf(Iterables.transform(nameParts,new Function<NamePart, String>() { public String apply(NamePart namePart) { return namePart.getName(); } })); }  ImmutableList<String> extractNames(ImmutableList<NamePart> nameParts);  }
@Test public void shouldExtractAllNames() { Assert.assertEquals("[United States, California, Los Angeles county, Los Angeles]", new FullyQualifiedNamesExtractor().extractNames( losAngelesNameProvider().getFullyQualifiedNameParts()).toString()); }