@ParameterizedTest
    @MethodSource("nonExceptionalData")
    public void shouldSerializeAndDeserialize(final TestCase testCase) {
        final SegmentValue segmentValue = buildSegmentWithInsertLatest(testCase);

        final byte[] serialized = segmentValue.serialize();
        final SegmentValue deserialized = RocksDBVersionedStoreSegmentValueFormatter.deserialize(serialized);

        verifySegmentContents(deserialized, testCase);
    }
These scenarios may only be hit in the event of an earlier exception, such as failure to
write to a particular segment store of {@link RocksDBVersionedStore} resulting in an
inconsistency among segments. These tests verify that the store is able to recover
gracefully even if this happens.
streams/src/test/java/org/apache/kafka/streams/state/internals/RocksDBVersionedStoreSegmentValueFormatterTest.java