@Test
public void recordHighestSeenPartitionWhenTasksCompleteOutOfOrder() {

    // every 10 partitions, the highest seen token is reported to the journal. Here,
    // randomise the iteration of the keys to simulate tasks completing out of order
    RangeComparator comparator = comparator(context(0L, 100L));
    long[] tokens = new long[] {2, 8, 1, 4, 100, 3, 5, 7, 6, 9};
    comparator.compare(keys(tokens),
                       keys(tokens),
                       this::alwaysMatch);
    assertReported(100, RangeStats.withValues(10, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), journal);
    assertEquals(1, journal.keySet().size());
    assertNothingReported(errors, mismatches);
    assertCompared(tokens);
}