### Question:
StringUtil { public static String join(String[] array, String separator) { int len = array.length; if (len == 0) { return ""; } StringBuilder out = new StringBuilder(); out.append(array[0]); for (int i = 1; i < len; i++) { out.append(separator).append(array[i]); } return out.toString(); }  static boolean containsIgnoreCase(String[] array, String value); static String join(String[] array, String separator); static String join(Collection<String> list, String separator);  }### Answer:
@Test public void testJoin() { String[] array = {"aa", "bb", "cc"}; assertEquals("aa,bb,cc", StringUtil.join(array, ",")); assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); assertEquals("aabbcc", StringUtil.join(array, "")); assertEquals("aa bb cc", StringUtil.join(array, " ")); assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); assertEquals("", StringUtil.join(new String[]{}, ",")); assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); }