Java tutorial
//package com.java2s; public class Main { public static String toString(Iterable<?> iterable) { if (iterable == null) throw new IllegalArgumentException(); StringBuilder sb = new StringBuilder(); for (Object value : iterable) { if (sb.length() > 0) { sb.append(", "); } sb.append(value); } return sb.toString(); } }