public static String join(String glue, Iterable strings) { if (strings == null) ret ""; new StringBuilder buf; Iterator i = strings.iterator(); if (i.hasNext()) { buf.append(i.next()); while (i.hasNext()) buf.append(glue).append(i.next()); } ret buf.toString(); } public static S join(S glue, S... strings) { ret join(glue, Arrays.asList(strings)); } static S join(Iterable strings) { ret join("", strings); } static S join(Iterable strings, S glue) { ret join(glue, strings); } public static S join(String[] strings) { ret join("", strings); }