public static boolean checkpointsMatch(
            Collection<CompletedCheckpoint> first, Collection<CompletedCheckpoint> second) {
        if (first.size() != second.size()) {
            return false;
        }

        List<Tuple2<Long, JobID>> firstInterestingFields = new ArrayList<>(first.size());

        for (CompletedCheckpoint checkpoint : first) {
            firstInterestingFields.add(
                    new Tuple2<>(checkpoint.getCheckpointID(), checkpoint.getJobId()));
        }

        List<Tuple2<Long, JobID>> secondInterestingFields = new ArrayList<>(second.size());

        for (CompletedCheckpoint checkpoint : second) {
            secondInterestingFields.add(
                    new Tuple2<>(checkpoint.getCheckpointID(), checkpoint.getJobId()));
        }

        return firstInterestingFields.equals(secondInterestingFields);
    }
@Test
    void testCompareCheckpointsWithSameJobID() {
        JobID jobID = new JobID();

        CompletedCheckpoint checkpoint1 =
                new CompletedCheckpoint(
                        jobID,
                        0,
                        0,
                        1,
                        new HashMap<>(),
                        Collections.emptyList(),
                        CheckpointProperties.forCheckpoint(
                                CheckpointRetentionPolicy.RETAIN_ON_FAILURE),
                        new TestCompletedCheckpointStorageLocation(),
                        null);

        CompletedCheckpoint checkpoint2 =
                new CompletedCheckpoint(
                        jobID,
                        1,
                        0,
                        1,
                        new HashMap<>(),
                        Collections.emptyList(),
                        CheckpointProperties.forCheckpoint(
                                CheckpointRetentionPolicy.RETAIN_ON_FAILURE),
                        new TestCompletedCheckpointStorageLocation(),
                        null);

        List<CompletedCheckpoint> checkpoints1 = new ArrayList<>();
        checkpoints1.add(checkpoint1);

        List<CompletedCheckpoint> checkpoints2 = new ArrayList<>();
        checkpoints2.add(checkpoint2);

        assertThat(CompletedCheckpoint.checkpointsMatch(checkpoints1, checkpoints2)).isFalse();
    }