@Test
    public void testFlush() {
        writeDataToSecondFile();

        {
            // First time  flush , flush position = indexFileSize (126)
            this.fileManager.flush();
            assertEquals(this.fileManager.getFlushedPosition(), 126);
        }

        {
            // Second time  flush , flush position = 212
            this.fileManager.flush();
            assertEquals(this.fileManager.getFlushedPosition(), 212);
        }
    }
When call writeDataToFirstFile and writeDataToSecondFile
The fileManager's file state is :

fileId   fileFromOffset    firstLogIndex  lastLogIndex  fileLastOffset         wrotePosition
0        0                 0              9             26 + 100 =216          26 + 100
1        26 + 100          10             15            26 + 26 + 160 = 212    26 + 60
jraft-extension/java-log-storage-impl/src/test/java/com/alipay/sofa/jraft/storage/file/FileManagerTest.java