Here you can find the source of joinStrings(Collection
public static String joinStrings(Collection<String> names)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static String joinStrings(Collection<String> names) { StringBuilder sb = new StringBuilder(1000); for (String name : names) { if (sb.length() > 0) { sb.append(", "); }/*from w w w .j av a 2 s. co m*/ sb.append(name); } return sb.toString(); } }