### Question:
ContributorHelper { public static String formatContributors(String artist, List<String> contributors) { StringBuilder buffer = new StringBuilder(); buffer.append(artist); if (contributors.size() > 0) buffer.append(" featuring "); for (int i = 0, c = contributors.size(); i < c; i++) { String contributor = contributors.get(i); buffer.append(contributor); if (i < c - 1) buffer.append(", "); } return buffer.toString(); }  static List<String> parseArtist(String artist); static List<String> parseTrack(String track); static String formatContributors(String artist, List<String> contributors);  }### Answer:
@Test public void testFormatContributors() { assertEquals("A", formatContributors("A", Collections.<String>emptyList())); assertEquals("A featuring B", formatContributors("A", singletonList("B"))); assertEquals("A featuring B, C", formatContributors("A", asList("B", "C"))); assertEquals("A featuring B, C, D", formatContributors("A", asList("B", "C", "D"))); }