Here you can find the source of collectionToList(Iterable extends Object> c)
public static String collectionToList(Iterable<? extends Object> c)
//package com.java2s; //License from project: Open Source License import java.util.Iterator; public class Main { public static String collectionToList(Iterable<? extends Object> c) { StringBuffer ret = new StringBuffer(); for (Iterator<? extends Object> itr = c.iterator(); itr.hasNext();) { ret.append(itr.next().toString()); if (itr.hasNext()) ret.append(","); }//from www .j a v a 2 s. co m return ret.toString(); } }