@Test public void testJoiningEmptyCollectionReturnsEmptyString() { assertEquals("", StringTools.join(new ArrayList<String>(), ", ")); }
public static <T> String join(Collection<T> collection, String delimiter) { final StringBuilder builder = new StringBuilder(); boolean first = true; for(T o : collection) { if(!first) { builder.append(delimiter); } builder.append(o); first = false; } return builder.toString(); }
StringTools { public static <T> String join(Collection<T> collection, String delimiter) { final StringBuilder builder = new StringBuilder(); boolean first = true; for(T o : collection) { if(!first) { builder.append(delimiter); } builder.append(o); first = false; } return builder.toString(); } }
StringTools { public static <T> String join(Collection<T> collection, String delimiter) { final StringBuilder builder = new StringBuilder(); boolean first = true; for(T o : collection) { if(!first) { builder.append(delimiter); } builder.append(o); first = false; } return builder.toString(); }  }
StringTools { public static <T> String join(Collection<T> collection, String delimiter) { final StringBuilder builder = new StringBuilder(); boolean first = true; for(T o : collection) { if(!first) { builder.append(delimiter); } builder.append(o); first = false; } return builder.toString(); }  static String string_to_escaped_string(String s, char first_and_last_char); static String createRegexFromGlob(String glob); static String join(Collection<T> collection, String delimiter); static String getStackTrace(Throwable e); }
StringTools { public static <T> String join(Collection<T> collection, String delimiter) { final StringBuilder builder = new StringBuilder(); boolean first = true; for(T o : collection) { if(!first) { builder.append(delimiter); } builder.append(o); first = false; } return builder.toString(); }  static String string_to_escaped_string(String s, char first_and_last_char); static String createRegexFromGlob(String glob); static String join(Collection<T> collection, String delimiter); static String getStackTrace(Throwable e);  }