public void flush() throws IOException {
        FileChannel channel = channelOrNull();
        if (channel != null)
            channel.force(true);
    }
@Test
    public void testFlush() throws IOException {
        File nonExistentFile = TestUtils.tempFile();
        assertTrue(nonExistentFile.delete());
        try (TransactionIndex testIndex = new TransactionIndex(0, nonExistentFile)) {
            testIndex.flush();
            testIndex.append(new AbortedTxn(0L, 0, 10, 2));
            testIndex.flush();
            assertNotEquals(0, testIndex.file().length());
        }
    }