@Test
    public void testSequenceAndEpochInVerificationEntry() {
        VerificationStateEntry originalEntry = stateManager.maybeCreateVerificationStateEntry(producerId, 1, epoch);
        VerificationGuard originalEntryVerificationGuard = originalEntry.verificationGuard();

        verifyEntry(originalEntryVerificationGuard, originalEntry, 1, epoch);

        // If we see a lower sequence, update to the lower one.
        VerificationStateEntry updatedEntry = stateManager.maybeCreateVerificationStateEntry(producerId, 0, epoch);
        verifyEntry(originalEntryVerificationGuard, updatedEntry, 0, epoch);

        // If we see a new epoch that is higher, update the sequence.
        VerificationStateEntry updatedEntryNewEpoch = stateManager.maybeCreateVerificationStateEntry(producerId, 2, (short) 1);
        verifyEntry(originalEntryVerificationGuard, updatedEntryNewEpoch, 2, (short) 1);

        // Ignore a lower epoch.
        VerificationStateEntry updatedEntryOldEpoch = stateManager.maybeCreateVerificationStateEntry(producerId, 0, epoch);
        verifyEntry(originalEntryVerificationGuard, updatedEntryOldEpoch, 2, (short) 1);
    }
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