Code example for ListIterator

Methods: add, next

0
    } 
 
    @Test(expected = UnsupportedOperationException.class) 
    public void testListIteratorAdd() { 
        ListIterator<Integer> itr = createList().listIterator();
        itr.next();
        itr.add(100);
    } 
 
    @Test(expected = UnsupportedOperationException.class) 
    public void testListIteratorSet() { 
        ListIterator<Integer> itr = createList().listIterator();
        itr.next();
        itr.set(100);
    } 
 
    private static List<Integer> createList() {
        List<Integer> list = RandomListFactory.INSTANCE.concatView(Arrays.asList(1, 2), Arrays.asList(3, 4, 5));
        Assert.assertEquals(5, list.size());
        return list;
    }