Code review comment: see below

Code before review:
void testFailover() throws Exception {
OperatorSubtaskState state;
try (OneInputStreamOperatorTestHarness<RowData, PartitionCommitInfo> harness = create()) {
harness.setup();
harness.initializeEmptyState();
harness.open();
harness.processElement(row("1"), 0);
harness.processElement(row("2"), 0);
harness.processElement(row("2"), 0);
state = harness.snapshot(1, 1);
harness.processElement(row("3"), 0);
harness.processElement(row("4"), 0);
harness.notifyOfCompletedCheckpoint(1);
List<String> partitions = collect(harness);
assertThat(partitions).isEqualTo(Arrays.asList("1", "2"));
}
try (OneInputStreamOperatorTestHarness<RowData, PartitionCommitInfo> harness = create()) {
harness.setup();
harness.initializeState(state);
harness.open();
harness.processElement(row("3"), 0);
harness.processElement(row("4"), 0);
state = harness.snapshot(2, 2);
harness.notifyOfCompletedCheckpoint(2);
List<String> partitions = collect(harness);
assertThat(partitions).isEqualTo(Arrays.asList("1", "2", "3", "4"));
}
try (OneInputStreamOperatorTestHarness<RowData, PartitionCommitInfo> harness = create()) {
harness.setup();
harness.initializeState(state);
harness.open();
harness.processElement(row("4"), 0);
harness.processElement(row("5"), 0);
state = harness.snapshot(3, 3);
harness.notifyOfCompletedCheckpoint(3);
List<String> partitions = collect(harness);
assertThat(partitions).isEqualTo(Arrays.asList("3", "4", "5"));
}
try (OneInputStreamOperatorTestHarness<RowData, PartitionCommitInfo> harness = create()) {
harness.setup();
harness.initializeState(state);
harness.open();
harness.processElement(row("6"), 0);
harness.processElement(row("7"), 0);
harness.snapshot(4, 4);
harness.processElement(row("8"), 0);
harness.snapshot(5, 5);
harness.processElement(row("9"), 0);
harness.snapshot(6, 6);
harness.notifyOfCompletedCheckpoint(5);
List<String> partitions = collect(harness);
assertThat(partitions).isEqualTo(Arrays.asList("4", "5", "6", "7", "8"));
}
}

Line under review: assertThat(partitions).isEqualTo(Arrays.asList("4", "5", "6", "7", "8"));

Code after addressing the review:
void testFailover() throws Exception {
OperatorSubtaskState state;
try (OneInputStreamOperatorTestHarness<RowData, PartitionCommitInfo> harness = create()) {
harness.setup();
harness.initializeEmptyState();
harness.open();
harness.processElement(row("1"), 0);
harness.processElement(row("2"), 0);
harness.processElement(row("2"), 0);
state = harness.snapshot(1, 1);
harness.processElement(row("3"), 0);
harness.processElement(row("4"), 0);
harness.notifyOfCompletedCheckpoint(1);
List<String> partitions = collect(harness);
assertThat(partitions).containsExactly("1", "2");
}
try (OneInputStreamOperatorTestHarness<RowData, PartitionCommitInfo> harness = create()) {
harness.setup();
harness.initializeState(state);
harness.open();
harness.processElement(row("3"), 0);
harness.processElement(row("4"), 0);
state = harness.snapshot(2, 2);
harness.notifyOfCompletedCheckpoint(2);
List<String> partitions = collect(harness);
assertThat(partitions).containsExactly("1", "2", "3", "4");
}
try (OneInputStreamOperatorTestHarness<RowData, PartitionCommitInfo> harness = create()) {
harness.setup();
harness.initializeState(state);
harness.open();
harness.processElement(row("4"), 0);
harness.processElement(row("5"), 0);
state = harness.snapshot(3, 3);
harness.notifyOfCompletedCheckpoint(3);
List<String> partitions = collect(harness);
assertThat(partitions).containsExactly("3", "4", "5");
}
try (OneInputStreamOperatorTestHarness<RowData, PartitionCommitInfo> harness = create()) {
harness.setup();
harness.initializeState(state);
harness.open();
harness.processElement(row("6"), 0);
harness.processElement(row("7"), 0);
harness.snapshot(4, 4);
harness.processElement(row("8"), 0);
harness.snapshot(5, 5);
harness.processElement(row("9"), 0);
harness.snapshot(6, 6);
harness.notifyOfCompletedCheckpoint(5);
List<String> partitions = collect(harness);
assertThat(partitions).containsExactly("4", "5", "6", "7", "8");
}
}