private void verifyLastEntryWithTxnData(ProducerStateEntry lastEntry,
                                            int expectedFirstSeq,
                                            long expectedLastSeq,
                                            long expectedFirstDataOffset,
                                            long expectedLastDataOffset,
                                            OptionalLong expectedCurrentTxnFirstOffset,
                                            ProducerAppendInfo appendInfo) {
        assertEquals(epoch, lastEntry.producerEpoch());
        assertEquals(expectedFirstSeq, lastEntry.firstSeq());
        assertEquals(expectedLastSeq, lastEntry.lastSeq());
        assertEquals(expectedFirstDataOffset, lastEntry.firstDataOffset());
        assertEquals(expectedLastDataOffset, lastEntry.lastDataOffset());
        assertEquals(expectedCurrentTxnFirstOffset, lastEntry.currentTxnFirstOffset());
        assertTxnMetadataEquals(singletonList(new TxnMetadata(producerId, 16L)), appendInfo.startedTransactions());
    }
Test that marking a snapshot for deletion when the file has already been deleted
returns None instead of the SnapshotFile. The snapshot file should be removed from
the in-memory state of the ProducerStateManager. This scenario can occur during log
recovery when the intermediate ProducerStateManager instance deletes a file without
updating the state of the "real" ProducerStateManager instance which is passed to the Log.
storage/src/test/java/org/apache/kafka/storage/internals/log/ProducerStateManagerTest.java