Here you can find the source of asString(Collection extends String> collection)
public static final String asString(Collection<? extends String> collection)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static final String asString(Collection<? extends String> collection) { if (isEmpty(collection)) { return ""; }//from w ww . j a va 2s . c o m final StringBuilder asList = new StringBuilder(64); for (String item : collection) { asList.append(", ").append(item); } return asList.substring(2); } public static final boolean isEmpty(Collection<?> collection) { return (collection == null || collection.size() == 0); } }