@Test
    void testIteratorJuggling() {
        AndItem a = new AndItem();
        WordItem w0 = new WordItem("nalle");
        WordItem w1 = new WordItem("bamse");
        WordItem w2 = new WordItem("teddy");
        boolean caught = false;
        a.addItem(w0);
        a.addItem(w1);
        ListIterator<Item> i = a.getItemIterator();
        assertFalse(i.hasPrevious());
        try {
            i.previous();
        } catch (NoSuchElementException e) {
            caught = true;
        }
        assertTrue(caught);
        assertEquals(-1, i.previousIndex());
        assertEquals(0, i.nextIndex());
        i.next();
        WordItem wn = (WordItem) i.next();
        assertSame(w1, wn);
        assertSame(w1, i.previous());
        assertSame(w0, i.previous());
        assertEquals(0, i.nextIndex());
        i.add(w2);
        assertEquals(1, i.nextIndex());
    }
Check basic contracts common to "many" item implementations.

@author Steinar Knutsen
container-search/src/test/java/com/yahoo/prelude/query/ItemsCommonStuffTestCase.java