@Test
public void testHasNext() {

	try {
		// create the resettable Iterator
		SpillingResettableIterator<IntValue> iterator = new SpillingResettableIterator<IntValue>(
				this.reader, this.serializer, this.memman, this.ioman, 2, this.memOwner);
		// open the iterator
		iterator.open();

		int cnt = 0;
		while (iterator.hasNext()) {
			iterator.hasNext();
			iterator.next();
			cnt++;
		}

		Assert.assertTrue(cnt + " elements read from iterator, but " + NUM_TESTRECORDS + " expected",
			cnt == NUM_TESTRECORDS);
		
		iterator.close();
	} catch (Exception ex)  {
		ex.printStackTrace();
		Assert.fail("Test encountered an exception.");
	}
}