It incorrectly, was returning an error, when it actually wanted to assert that the array bounds were not exceeded. Fixed by using ArrayList instead.