@Test
public void testSync() throws IOException {

    File bd = mkdir("sync");
    File first = new File(bd, "0000000000000000-0000000000000000-0.qdb");
    PersistentMessageBuffer b = new PersistentMessageBuffer(bd);
    append(b, 0, "", 8192);
    assertEquals(4096, getStoredLength(first));     // just the file header
    b.sync();
    assertEquals(4096 + 8192, getStoredLength(first));
    b.close();
}