Here you can find the source of prettyPrintCollection(Collection
public static <T> String prettyPrintCollection(Collection<T> collection)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { private static final String COMMA = ","; public static <T> String prettyPrintCollection(Collection<T> collection) { StringBuilder sb = new StringBuilder(collection.size()); for (T element : collection) { sb.append(element).append(COMMA); }//from w w w. j a v a2s . c om return sb.toString(); } }