Code example for NoSuchElementException

0
        if (!peekedAtNext) { 
            hasAnother = resultSet.next(); 
        } 
        peekedAtNext = false; 
        if (!hasAnother) 
            throw new NoSuchElementException(); 
        return resultSet; 
    } 
     
    @Override 
    public boolean hasNext() { 
        if (!peekedAtNext) { 
            hasAnother = resultSet.next(); 
            peekedAtNext = true; 
        } 
        return hasAnother; 
    } 
     
    /** Row removal is not supported; use IResultSet.deleteRow instead. 
     */ 
    @Override