public void testSetArray() { Iterator iter1 = makeArrayIterator(testArray); int count1 = 0; while (iter1.hasNext()) { ++count1; iter1.next(); } assertEquals("the count should be right using the constructor", count1, testArray.length); ArrayIterator iter2 = makeArrayIterator(); iter2.setArray(testArray); int count2 = 0; while (iter2.hasNext()) { ++count2; iter2.next(); } assertEquals("the count should be right using setArray(Object)", count2, testArray.length); }