public boolean isCheckpointPending() {
        return !pendingCheckpoints.isEmpty();
    }
@Test
    void testNoFastPathWithChannelFinishedDuringCheckpoints() throws Exception {
        BufferOrEvent[] sequence = {
            createBarrier(1, 0), createEndOfPartition(0), createBarrier(1, 1)
        };

        ValidatingCheckpointHandler validator = new ValidatingCheckpointHandler();
        inputGate = createCheckpointedInputGate(2, sequence, validator);

        for (BufferOrEvent boe : sequence) {
            assertThat(inputGate.pollNext()).hasValue(boe);
        }

        // The last barrier should finish the pending checkpoint instead of trigger a "new" one.
        assertThat(validator.getTriggeredCheckpointCounter()).isOne();
        assertThat(inputGate.getCheckpointBarrierHandler().isCheckpointPending()).isFalse();
    }