Here you can find the source of toList(Collection addresses, char separator)
static String toList(Collection addresses, char separator)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.Iterator; public class Main { /**// w w w . j a v a 2 s . com * Format all strings in the collection by using the specified separator. */ static String toList(Collection addresses, char separator) { StringBuffer buf = new StringBuffer(); for (Iterator itr = addresses.iterator(); itr.hasNext();) { String address = (String) itr.next(); if (buf.length() > 0) buf.append(separator); buf.append(address); } return buf.toString(); } }