### Question:
ContributorHelper { public static List<String> parseArtist(String artist) { Pattern pattern = Pattern.compile("(.+)(( (F|f)eat(\\. |\\.| |uring ))(.+))"); Matcher matcher = pattern.matcher(artist); boolean matches = matcher.matches(); if (matches) { String lead = matcher.group(1).trim(); String featuring = matcher.group(6).trim(); return createContributorList(lead, featuring); } pattern = Pattern.compile("(.+)(( (A|a|U|u)nd )|&)(.+)"); matcher = pattern.matcher(artist); matches = matcher.matches(); if (matches) { String lead = matcher.group(1).trim(); String featuring = matcher.group(5).trim(); return createContributorList(lead, featuring); } return singletonList(artist); }  static List<String> parseArtist(String artist); static List<String> parseTrack(String track); static String formatContributors(String artist, List<String> contributors);  }### Answer:
@Test public void testParseArtist() { assertEquals(singletonList("A"), parseArtist("A")); assertEquals(asList("A", "B"), parseArtist("A and B")); assertEquals(asList("A", "B"), parseArtist("A feat. B")); assertEquals(asList("A", "B"), parseArtist("A Feat. B")); assertEquals(asList("A", "B"), parseArtist("A featuring B")); assertEquals(asList("A", "B"), parseArtist("A Featuring B")); assertEquals(singletonList("A"), parseArtist(formatContributors("A", Collections.<String>emptyList()))); assertEquals(asList("A", "B"), parseArtist(formatContributors("A", singletonList("B")))); assertEquals(asList("A", "B", "C"), parseArtist(formatContributors("A", asList("B", "C")))); }