LevelDBWriteOptions implements AutoCloseable { public void close() { checkWriteOptionsOpen(); LevelDBNative.leveldb_writeoptions_destroy(writeOptions); writeOptions = null; } LevelDBWriteOptions(); void close(); boolean isSync(); void setSync(boolean sync);  }
@Test public void create_and_close() { LevelDBWriteOptions writeOptions = new LevelDBWriteOptions(); writeOptions.close(); }
@Test(expected = LevelDBException.class) public void create_and_close_twice() { LevelDBWriteOptions writeOptions = new LevelDBWriteOptions(); writeOptions.close(); writeOptions.close(); }