Code example for ListIterator

Methods: hasNexthasPreviousnextnextIndexprevious

0
		Wrapper date = new DateWrapper(time1);
 
		addService(date);
		addService(date);
 
		assertEquals(0, iter.nextIndex());
		Wrapper proxy1 = (Wrapper) iter.next();
 
		assertEquals(new Long(time1), proxy1.execute());
		removeService(date);
 
		assertEquals(1, iter.nextIndex());
		assertFalse(iter.hasNext());
		assertTrue(iter.hasPrevious());
		Wrapper proxy2 = ((Wrapper) iter.previous());
		assertEquals(new Long(time1), proxy2.execute());
 
		assertSame(proxy1, proxy2);
 
	} 
}