Java tutorial
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static String collectionToStr(Collection<?> collection) { if (collection != null) { StringBuilder sb = new StringBuilder(); for (Object obj : collection) { sb.append(obj.toString()); } return sb.toString(); } else { return ""; } } }