public void testNextAndPrevious()
{
List col = createFilterColl(middleView);
assertEquals( "view list size", 3, col.size() );
ListIterator listIter = col.listIterator();
assertTrue( "hasNext", listIter.hasNext() );
assertEquals( "next index", 0, listIter.nextIndex() );
assertEquals( "next", fullView[0], listIter.next() );
assertTrue( "hasNext", listIter.hasNext() );
assertEquals( "next index", 1, listIter.nextIndex() );
assertEquals( "next", fullView[1], listIter.next() );
assertTrue( "hasNext", listIter.hasNext() );
assertEquals( "next index", 2, listIter.nextIndex() );
assertEquals( "next", fullView[2], listIter.next() );
assertFalse( "hasNext", listIter.hasNext() );
// We are at the end of the list. Go back
assertTrue( "hasPrevious", listIter.hasPrevious() );
assertEquals( "previous index", 2, listIter.previousIndex() );
assertEquals( "previous", fullView[2], listIter.previous() );
assertTrue( "hasPrevious", listIter.hasPrevious() );
assertEquals( "previous index", 1, listIter.previousIndex() );
assertEquals( "previous", fullView[1], listIter.previous() );
assertTrue( "hasPrevious", listIter.hasPrevious() );
assertEquals( "previous index", 0, listIter.previousIndex() );
assertEquals( "previous", fullView[0], listIter.previous() );
assertFalse( "hasPrevious", listIter.hasPrevious() );
assertEquals( "previous index", -1, listIter.previousIndex() );
}