Code example for NoSuchElementException

0
 
        @Override 
        /** FIXME: before previous(), next() must be called. */ 
        public E previous() { 
            if (index <= 0) {
                throw new NoSuchElementException();
            } 
            index--;
            E entity = get(index);
            // if (index == size && closeWhenDone) { 
            // close(); 
            // } 
            return entity;
        } 
 
        @Override 
        public int previousIndex() { 
            return index - 1;
        } 
 
        @Override