Iterables { public static int count(Iterable<?> iterable) { int count = 0; for (Object next : iterable) { count++; } return count; } 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 testCount() { Assert.assertEquals(4, Iterables.count(DUMMY_COLLECTION)); }