public void takeSnapshot() throws IOException {
        takeSnapshot(true);
    }
@Test
    public void testSkipSnapshotIfOffsetUnchanged() throws IOException {
        appendClientEntry(stateManager, producerId, epoch, defaultSequence, 0L, 0L, false);

        stateManager.takeSnapshot();
        assertEquals(1, Objects.requireNonNull(logDir.listFiles()).length);
        assertEquals(singleton(1L), currentSnapshotOffsets());

        // nothing changed so there should be no new snapshot
        stateManager.takeSnapshot();
        assertEquals(1, Objects.requireNonNull(logDir.listFiles()).length);
        assertEquals(singleton(1L), currentSnapshotOffsets());
    }