Here you can find the source of convertListToString(Collection
private static <T> String convertListToString(Collection<T> list)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { private static <T> String convertListToString(Collection<T> list) { String stringOfList = ""; if (list != null) { StringBuffer sb = new StringBuffer(); boolean firstTime = true; for (T item : list) { if (firstTime) { sb.append(item);/* ww w . ja v a 2s . c o m*/ firstTime = false; } else { sb.append("||" + item); } } stringOfList = sb.toString(); } return stringOfList; } }