CheckpointStatsCounts createSnapshot() {
        return new CheckpointStatsCounts(
                numRestoredCheckpoints,
                numTotalCheckpoints,
                numInProgressCheckpoints,
                numCompletedCheckpoints,
                numFailedCheckpoints);
    }
@Test
    void testCreateSnapshot() {
        CheckpointStatsCounts counts = new CheckpointStatsCounts();
        counts.incrementRestoredCheckpoints();
        counts.incrementRestoredCheckpoints();
        counts.incrementRestoredCheckpoints();

        counts.incrementInProgressCheckpoints();
        counts.incrementCompletedCheckpoints();

        counts.incrementInProgressCheckpoints();
        counts.incrementCompletedCheckpoints();

        counts.incrementInProgressCheckpoints();
        counts.incrementCompletedCheckpoints();

        counts.incrementInProgressCheckpoints();
        counts.incrementCompletedCheckpoints();

        counts.incrementInProgressCheckpoints();
        counts.incrementFailedCheckpoints();

        long restored = counts.getNumberOfRestoredCheckpoints();
        long total = counts.getTotalNumberOfCheckpoints();
        long inProgress = counts.getNumberOfInProgressCheckpoints();
        long completed = counts.getNumberOfCompletedCheckpoints();
        long failed = counts.getNumberOfFailedCheckpoints();

        CheckpointStatsCounts snapshot = counts.createSnapshot();
        assertThat(snapshot.getNumberOfRestoredCheckpoints()).isEqualTo(restored);
        assertThat(snapshot.getTotalNumberOfCheckpoints()).isEqualTo(total);
        assertThat(snapshot.getNumberOfInProgressCheckpoints()).isEqualTo(inProgress);
        assertThat(snapshot.getNumberOfCompletedCheckpoints()).isEqualTo(completed);
        assertThat(snapshot.getNumberOfFailedCheckpoints()).isEqualTo(failed);

        // Update the original
        counts.incrementRestoredCheckpoints();
        counts.incrementRestoredCheckpoints();

        counts.incrementInProgressCheckpoints();
        counts.incrementCompletedCheckpoints();

        counts.incrementInProgressCheckpoints();
        counts.incrementFailedCheckpoints();

        assertThat(snapshot.getNumberOfRestoredCheckpoints()).isEqualTo(restored);
        assertThat(snapshot.getTotalNumberOfCheckpoints()).isEqualTo(total);
        assertThat(snapshot.getNumberOfInProgressCheckpoints()).isEqualTo(inProgress);
        assertThat(snapshot.getNumberOfCompletedCheckpoints()).isEqualTo(completed);
        assertThat(snapshot.getNumberOfFailedCheckpoints()).isEqualTo(failed);
    }