It seems to me that I have written the correct solution but it isn't letting me pass through.
private boolean compressRow(int[] row) {
    int[] newRow = {0, 0, 0, 0};
    int i = 0;
    for (int x = 0; x < 4; x++) {
        while (row[x] != 0 && i < 4) {
            newRow[i] = row[x];
            ++i;
        }
    }
    row = newRow;
    return (newRow != row);
}