public <R> Visitor.Result visitNeighbors(Layer<Coordinate2D> layer, int radius, Visitor<Column, R> v, Column column, R arg) {
        Visitor.Result result = Visitor.Result.NO_VISITS;
        Coordinate2D loc = coordinateForIndex(column.index());
        for (int x = loc.x - radius; x < loc.x + radius; x++) {
            if (x < 0 || x >= width) {
                continue;
            }
            for (int y = loc.y - radius; y < loc.y + radius; y++) {
                if (y < 0 || y >= height) {
                    continue;
                }
                Column c = getColumn(layer, loc);
                result = v.visit(c, arg);
                if (result.isDone()) {
                    break;
                }
            }
        }
        return result;
    }