Iterables { public static String toString(Iterable<?> iterable) { StringBuilder sb = new StringBuilder(); sb.append("["); for (Iterator<?> i = iterable.iterator(); i.hasNext();) { sb.append(i.next()); if (i.hasNext()) { sb.append(", "); } } sb.append("]"); return sb.toString(); } Iterables(); static List<T> toList(Iterable<T> iterable); static Set<T> toSet(Iterable<T> iterable); static String toString(Iterable<?> iterable); static int count(Iterable<?> iterable);  }
@Test public void testToString() { Assert.assertEquals("[1, 2, 3, 4]", Iterables.toString(DUMMY_COLLECTION)); }