public boolean flush() {
        final long flushWhere = getFlushedPosition();
        final AbstractFile abstractFile = findFileByOffset(flushWhere, flushWhere == 0);
        if (abstractFile != null) {
            final int flushOffset = abstractFile.flush();
            setFlushedPosition(abstractFile.getFileFromOffset() + flushOffset);
            return getFlushedPosition() != flushWhere;
        }
        return false;
    }
@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);
        }
    }