Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Collection; import java.util.Iterator; public class Main { public static String getPrettyString(Collection<?> coll) { StringBuffer sb = new StringBuffer(); Iterator<?> it = coll.iterator(); while (it.hasNext()) { String s = it.next().toString(); sb.append(s + "\n"); } return sb.toString().trim(); } }