You shouldn't use forEach loop, if you remove elements inside the loop. Look at this question.
That being said, you can do it like this for example:
private Array<Block> blocks = new Array<Block>();
private Block[] removedBlocks = new Block[4];
void someMethod() {
//...
// skip non-null removed blocks
int j = 0;
for (Block b : removedBlocks) {
if (b != null) j++;
}
int i = 0;
while (i < blocks.size) {
if (blocks.get(i).checkBlockCollision(frame)) {
//removing by index is faster, and it returns removed element, so you can do it like this
removedBlocks[j++] = blocks.removeIndex(i);
if (j == removedBlocks.length) {
//game over
break;
}
} else {
i++;
}
}
}
I have to note, that although you can use non-dynamic array here, it would be much more convenient to use dynamic array. For example, you wouldn't have to check, how many non-null references in the array. And clearing a dynamic array takes one method call, when with non-dynamic array, you need to do it in a loop.
Think about it, maybe you will want to change your approach.