@Override
    public int compare(final Bytes cacheKey, final Long storeKey) {
        final byte[] binaryKey = bytesFromCacheKey(cacheKey);

        final Long cacheTimestamp = timestampExtractor.apply(binaryKey);
        return cacheTimestamp.compareTo(storeKey);
    }
Merges two iterators. Assumes each of them is sorted by key
streams/src/main/java/org/apache/kafka/streams/state/internals/MergedSortedCacheWindowStoreIterator.java