Code example for NoSuchElementException

0
    } 
 
    @Override 
    public BlockVector next() { 
        if (!hasNext()) { 
            throw new NoSuchElementException();
        } 
 
        BlockVector current = new BlockVector(next2D.getBlockX(), nextY, next2D.getBlockZ());
        if (nextY < maxY) {
            nextY++;
        } else if (flatIterator.hasNext()) {
            next2D = flatIterator.next();
            nextY = minY;
        } else { 
            next2D = null;
        } 
 
        return current;
    } 
Experience pair programming with AI  Get Codota for Java