Code example for NoSuchElementException

0
            source = items.listIterator(index);
        } 
 
        public Entry next() { 
            if (!source.hasNext()) {
                throw new NoSuchElementException();
            } 
            return new EntryImpl(offset + source.nextIndex(), source.next());
        } 
 
        public Entry previous() { 
            if (!source.hasPrevious()) {
                throw new NoSuchElementException();
            } 
            return new EntryImpl(offset + source.previousIndex(), source.previous());
        } 
 
        public int nextIndex() { 
            return offset + source.nextIndex();
        }