Here you can find the source of joinCollectionToString(Collection
public static <T extends Object> String joinCollectionToString(Collection<T> list, String str)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static <T extends Object> String joinCollectionToString(Collection<T> list, String str) { StringBuffer sb = new StringBuffer(100); for (Object entity : list) { if (sb.length() > 0) { sb.append(str);/*from w ww .j a va 2s . co m*/ } sb.append(String.valueOf(entity)); } return sb.toString(); } }