Here you can find the source of listToString(final List
public static String listToString(final List<String> stringList)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String listToString(final List<String> stringList) { StringBuffer str = new StringBuffer(); if (isNull(stringList)) { return null; } else {/*from www . j ava 2 s .c om*/ for (String string : stringList) { str.append(string); str.append(","); } } return str.toString(); } public static boolean isNull(final Object obj) { if (obj == null) { return true; } return false; } }