Code example for NoSuchElementException

0
            } 
 
            /** {@inheritDoc} */ 
            public Node next() {
                if (!hasNext()) { 
                    throw new NoSuchElementException();
                } 
                return nodeList.item(index++);
            } 
 
            /** {@inheritDoc} */ 
            public void remove() { 
                throw new UnsupportedOperationException();
            } 
        }; 
    } 
}