### Question:
CollectionUtil { public static String join(Collection<String> strings) { return join(strings, ", "); }  static String join(Collection<String> strings); static String join(Collection<String> strings, String separator); static boolean collectionEquals(Collection<T> col1, Collection<T> col2);  }### Answer:
@Test public void joinInputNoneOutputEmpty() { final ArrayList<String> strings = new ArrayList<>(); final String retval = CollectionUtil.join(strings, ","); Assert.assertEquals("", retval); }
@Test public void joinInput2SeparatorNull() { final ArrayList<String> strings = new ArrayList<>(); strings.add("foo"); strings.add("bar"); final String retval = CollectionUtil.join(strings, null); Assert.assertEquals("foonullbar", retval); }
@Test public void joinInput1SeparatorNotNull() { final ArrayList<String> strings = new ArrayList<>(); strings.add("foo"); final String retval = CollectionUtil.join(strings, ","); Assert.assertEquals("foo", retval); }
@Test public void joinInput2SeparatorNotNull() { final ArrayList<String> strings = new ArrayList<>(); strings.add("foo"); strings.add("bar"); final String retval = CollectionUtil.join(strings, ","); Assert.assertEquals("foo,bar", retval); }