public void sanityCheck() {
        ByteBuffer buffer = ByteBuffer.allocate(AbortedTxn.TOTAL_SIZE);
        for (AbortedTxnWithPosition txnWithPosition : iterable(() -> buffer)) {
            AbortedTxn abortedTxn = txnWithPosition.txn;
            if (abortedTxn.lastOffset() < startOffset)
                throw new CorruptIndexException("Last offset of aborted transaction " + abortedTxn + " in index "
                    + file.getAbsolutePath() + " is less than start offset " + startOffset);
        }
    }
Do a basic sanity check on this index to detect obvious problems.

@throws CorruptIndexException if any problems are found.
storage/src/main/java/org/apache/kafka/storage/internals/log/TransactionIndex.java