What about having a simple `for` loop here. Like:

```java
for (int i = columnPointers[k]; i < columnPointers[j + 1]; i++) {
    procedure.apply(rowIndices[i], j, values[i]);
}
```

There is something wrong with your code. First, `i = rowIndicies[k]`. And then you're getting row by `rowIndicies[i]`. This is strange. I guarantee it will fail tests.