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

        // Take snapshot
        stateManager.takeSnapshot();

        // Check that file exists and it is not empty
        String[] logDirs = Objects.requireNonNull(logDir.list());
        assertEquals(1, logDirs.length, "Directory doesn't contain a single file as expected");
        assertFalse(logDirs[0].isEmpty(), "Snapshot file is empty");
    }