Here you can find the source of getCsv(Collection
public static <T> String getCsv(Collection<T> collection)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static <T> String getCsv(Collection<T> collection) { String result = ""; if (collection.size() != 0) { result = getLocalCsv(collection); }//from ww w. ja v a2 s . co m return result; } public static <T> String getLocalCsv(Collection<T> coll) { StringBuilder buff = new StringBuilder(); int i = 0; for (T value : coll) { if (i != 0) { buff.append(","); } buff.append(value); i++; } return buff.toString(); } }