Here you can find the source of stringify(Collection> collection)
public static String stringify(Collection<?> collection)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static String stringify(Collection<?> collection) { StringBuilder buf = new StringBuilder(); for (Object o : collection) { if (buf.length() > 0) buf.append("\n"); buf.append(o);/*from w ww . j av a 2s .co m*/ } return buf.toString(); } }