@Test
    public void testPeekThenRemove() {
        PeekableListIterator<String> it = new PeekableListIterator<String>(strings.listIterator());

        it.peek();
        try {
            it.remove();  //this should not work!
            fail("should have gotten exception");
        } catch (IllegalStateException ise) {
            //niks
        }

        assertEquals("0", it.next());
        it.remove();  //this should work
        assertEquals(5, strings.size());
        assertEquals("1", strings.get(0));
        assertEquals("2", strings.get(1));
        assertEquals("3", strings.get(2));
        assertEquals("4", strings.get(3));
        assertEquals("5", strings.get(4));
    }
Tests that PeekableListIterator behaves as expected.

@author Einar M R Rosenvinge
document/src/test/java/com/yahoo/document/annotation/PeekableListIteratorTestCase.java