@Test
    public void writeDataToFirstFile() {
        // Append 10 index to first file , and come to the file end (size:130)
        {
            for (int i = 0; i < 10; i++) {
                final AbstractFile lastFile = this.fileManager.getLastFile(i, 10, true);
                assert (lastFile instanceof IndexFile);
                final IndexFile indexFile = (IndexFile) lastFile;
                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