public void testIterator() { List<E> iteratorElements = new ArrayList<E>(); for (E element : collection) { // uses iterator() iteratorElements.add(element); } Helpers.assertEqualIgnoringOrder(Arrays.asList(createSamplesArray()), iteratorElements); }
public static void assertContentsAnyOrder(Iterable<?> actual, Object... expected) { assertEqualIgnoringOrder(Arrays.asList(expected), actual); }