private void assertSparseSyncInvariant(FakeOffsetSyncStore store, TopicPartition topicPartition) {
        for (int j = 0; j < OffsetSyncStore.SYNCS_PER_PARTITION; j++) {
            for (int i = 0; i < j; i++) {
                long jUpstream = store.syncFor(topicPartition, j).upstreamOffset();
                long iUpstream = store.syncFor(topicPartition, i).upstreamOffset();
                if (jUpstream == iUpstream) {
                    continue;
                }
                int exponent = Math.max(i - 2, 0);
                long iUpstreamLowerBound = jUpstream + (1L << exponent);
                if (iUpstreamLowerBound < 0) {
                    continue;
                }
                assertTrue(
                        iUpstream >= iUpstreamLowerBound,
                        "Invariant C(" + i + "," + j + "): Upstream offset " + iUpstream + " at position " + i
                                + " should be at least " + iUpstreamLowerBound
                                + " (" + jUpstream + " + 2^" + exponent + ")"
                );
                long iUpstreamUpperBound = jUpstream + (1L << j) - (1L << i);
                if (iUpstreamUpperBound < 0)
                    continue;
                assertTrue(
                        iUpstream <= iUpstreamUpperBound,
                        "Invariant B(" + i + "," + j + "): Upstream offset " + iUpstream + " at position " + i
                                + " should be no greater than " + iUpstreamUpperBound
                                + " (" + jUpstream + " + 2^" + j + " - 2^" + i + ")"

                );
            }
        }
    }
Simulate an OffsetSyncStore receiving a sequence of offset syncs as defined by their start offset and gaps.
After processing each simulated sync, assert that the store has not expired more unique syncs than the bound.
@param firstOffset First offset to give to the sync store after starting
@param steps A finite stream of gaps between syncs with some known distribution
@param maximumExpirations The maximum number of distinct syncs allowed to be expired after a single update.
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/OffsetSyncStoreTest.java