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

        // Try get last file again , this file is a new blank file (from allocator)
        final AbstractFile lastFile = this.fileManager.getLastFile(10, 10, true);
        assertEquals(lastFile.getFileFromOffset(), this.indexFileSize);

        // Write 5 index to second file , wrotePosition = 30 + 50
        final IndexFile indexFile = (IndexFile) lastFile;
        for (int i = 10; i <= 15; i++) {
            indexFile.appendIndex(i, i, segmentIndex);
        }
    }
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