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