Code example for NoSuchElementException

0
     */ 
    @Override 
    public T next() { 
        T localNext = next;
        if (localNext == null) {
            throw new NoSuchElementException();
        } 
        advance();  
        return localNext;
    } 
 
    /** 
     * {@inheritDoc} 
     */ 
    @Override 
    public void remove() { 
        throw new UnsupportedOperationException();
    } 
     
     
}