Code example for ListIterator

Methods: next, set

0
    } 
 
    @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;
    } 
 
    private enum RandomListFactory implements ConcatListTestMethods.ListFactory { 
        INSTANCE;
 
        @Override 
        public <E> List<E> concatView(List<? extends E> list1, List<? extends E> list2) {
            return new RandomAccessConcatListView<>(list1, list2);