@Test
    public void testReset() {
        SnapshotRegistry registry = new SnapshotRegistry(new LogContext());
        SnapshottableHashTable<TestElement> table =
            new SnapshottableHashTable<>(registry, 1);
        assertNull(table.snapshottableAddOrReplace(E_1A));
        assertNull(table.snapshottableAddOrReplace(E_2A));
        assertNull(table.snapshottableAddOrReplace(E_3A));
        registry.getOrCreateSnapshot(0);
        assertEquals(E_1A, table.snapshottableAddOrReplace(E_1B));
        assertEquals(E_3A, table.snapshottableAddOrReplace(E_3B));
        registry.getOrCreateSnapshot(1);

        registry.reset();

        assertEquals(Collections.emptyList(), registry.epochsList());
        // Check that the table is empty
        assertIteratorYields(table.snapshottableIterator(Long.MAX_VALUE));
    }
The class of test elements.

This class is intended to help test how the table handles distinct objects which
are equal to each other.  Therefore, for the purpose of hashing and equality, we
only check i here, and ignore j.
server-common/src/test/java/org/apache/kafka/timeline/SnapshottableHashTableTest.java