Here you can find the source of toCommaList(Collection> items)
public static String toCommaList(Collection<?> items)
//package com.java2s; import java.util.Collection; import java.util.Iterator; public class Main { public static String toCommaList(Collection<?> items) { if (items == null || items.size() == 0) return (null); String itemList = ""; Iterator<?> it = items.iterator(); while (it.hasNext()) { String item = it.next().toString(); itemList += item + ","; }//from www . j a va 2 s . c o m itemList = itemList.substring(0, itemList.length() - 1); return (itemList); } }