@Override
    public void reportCompletedCheckpoint(CompletedCheckpointStats completed) {
        statsReadWriteLock.lock();
        try {
            latestCompletedCheckpoint = completed;

            counts.incrementCompletedCheckpoints();
            history.replacePendingCheckpointById(completed);

            summary.updateSummary(completed);

            dirty = true;
            logCheckpointStatistics(completed);

            if (checkpointStatsListener != null) {
                checkpointStatsListener.onCompletedCheckpoint();
            }
        } finally {
            statsReadWriteLock.unlock();
        }
    }
@Test
    void testCheckpointStatsListenerOnCompletedCheckpoint() {
        testCheckpointStatsListener(
                (checkpointStatsTracker, pendingCheckpointStats) ->
                        checkpointStatsTracker.reportCompletedCheckpoint(
                                pendingCheckpointStats.toCompletedCheckpointStats(
                                        "random-external-pointer")),
                1,
                0);
    }