@Test
public void testMutlipleIteratorsResetMidIteration() {

   ArrayList<Integer> arrayList = new ArrayList<>();
   for (int i = 0; i < 1000; i++) {
      arrayList.add(i);
   }
   ArrayList<Integer> arrayList2 = new ArrayList<>();
   for (int i = 1000; i < 2000; i++) {
      arrayList2.add(i);
   }
   ArrayList<Integer> arrayList3 = new ArrayList<>();
   for (int i = 2000; i < 3000; i++) {
      arrayList3.add(i);
   }
   MultiResettableIterator<Integer> iterator = new MultiResettableIterator<>(new ResettableIterator[]{ArrayResettableIterator.iterator(arrayList), ArrayResettableIterator.iterator(arrayList2), ArrayResettableIterator.iterator(arrayList3)});
   for (int i = 0; i < 100; i++) {
      assertTrue(iterator.hasNext());
      assertEquals(Integer.valueOf(i), iterator.next());
   }
   //Reset and ensure we re-iterate all.
   iterator.reset();
   for (int i = 0; i < 3000; i++) {
      assertTrue(iterator.hasNext());
      assertNotNull(iterator.next());
   }
   assertFalse(iterator.hasNext());
}