### Question:
Joiner { public static String join(Iterable<String> src, String separator) { StringBuilder sb = new StringBuilder(); for (String s : src) { sb.append(s); sb.append(separator); } return sb.length() > 0 ? sb.substring(0, sb.length() - separator.length()) : ""; }  static String join(Iterable<String> src, String separator);  }### Answer:
@Test public void should_join_string_collection() { List<String> src = Arrays.asList("foo","bar","baz"); assertEquals("foo,bar,baz", Joiner.join(src, ",")); }
@Test public void single_value() { List<String> src = Arrays.asList("foo"); assertEquals("foo", Joiner.join(src, ",")); }
@Test public void long_separator() { List<String> src = Arrays.asList("foo","bar","baz"); assertEquals("foo && bar && baz", Joiner.join(src, " && ")); }