Here you can find the source of convertListToString(Iterable
public static String convertListToString(Iterable<Long> l)
//package com.java2s; //License from project: Apache License import java.util.Iterator; public class Main { public static String convertListToString(Iterable<Long> l) { return convertListToString(l, ", "); }/*from w w w . j a va2 s. com*/ public static String convertListToString(Iterable<Long> l, String separator) { if (separator == null) separator = ", "; StringBuilder buff = new StringBuilder(); for (Iterator<Long> it = l.iterator(); it.hasNext();) { buff.append(it.next()); if (it.hasNext()) { buff.append(separator); } } return buff.toString(); } }