JAVA: How to find a specific object in array matching certain criteria?

JAVA: How to find a specific object in array matching certain criteria?

I'm trying to find a certain block from my Block object Array by using the
X, and Y specified from the UI. I have been using a locator array making
duplicate entries alongside the main array in order to try this.
public Block get(int x, int y) {
int index = 0;
index = blocks.indexOf(locator[x][y], true);
return blocks.get(index);
}
This however spits back an java.lang.ArrayIndexOutOfBoundsException: -1/
It seems like it would work but am I overlooking something?