@Test
public void testOpenAndClose() throws Exception {

    byte[] keyBytes = randomBytes(16);
    File file = new File(folder.getRoot(), UUID.randomUUID().toString());
    for (int i = 0; i < 3; i++) {
        Database db = Database.build(file, keyBytes, null, null);
        boolean uniqueKeys = true;
        Btree btree = new Btree(db, uniqueKeys);
        if (i == 0) {
            simplePut(btree, 100);
        }
        simpleRead(btree, 100);
        System.out.println(btree.getDb().getPageStore().debugDump());
        System.out.flush();
        Assert.assertTrue(btree.getDb().getPageStore().debugIsIdle().or(true));
        db.close();
    }
}