Code example for ListIterator

Methods: previousremove

0
		assertEquals(dynamicList.size(), iter.nextIndex());
	} 
 
	public void testListIteratorPreviousException() { 
		try { 
			iter.previous();
			fail("should have thrown " + NoSuchElementException.class);
		} 
		catch (NoSuchElementException ex) {
			// expected 
		} 
 
		try { 
			iter.remove();
			fail("should have thrown " + IndexOutOfBoundsException.class + " or one of its subclasses");
		} 
		catch (IndexOutOfBoundsException ex) {
			// expected 
		} 
	}