ConcatenatingNameFormatter implements NameFormatter { public String format(NameProvider nameProvider) { return Join.join(delimiter,namesExtractor.extractNames(reverse(nameProvider.getFullyQualifiedNameParts()))); } ConcatenatingNameFormatter(String delimiter);  ConcatenatingNameFormatter(String delimiter, boolean reverse, NamesExtractor namesExtractor); String format(NameProvider nameProvider);  }
@Test public void shouldConcatenateAllNamesInReverseOrder() { Assert.assertEquals("Los Angeles,Los Angeles county,California,United States", reverseNameFormatter.format(losAngelesNameProvider()).toString()); }
@Test public void shouldConcatenateAllNamesInForwardOrder() { Assert.assertEquals("United States,California,Los Angeles county,Los Angeles", forwardNameFormatter.format(losAngelesNameProvider()).toString()); }