LevelDBOptions implements AutoCloseable { public void close() { checkOptionsOpen(); LevelDBNative.leveldb_options_destroy(options); options = null; } LevelDBOptions(); void close(); boolean isCreateIfMissing(); void setCreateIfMissing(boolean createIfMissing); boolean isErrorIfExists(); void setErrorIfExists(boolean errorIfExists); boolean isParanoidChecks(); void setParanoidChecks(boolean paranoidChecks); LevelDBCompressionType getCompressionType(); void setCompressionType(LevelDBCompressionType compressionType); long getWriteBufferSize(); void setWriteBufferSize(long writeBufferSize); int getMaxOpenFiles(); void setMaxOpenFiles(int maxOpenFiles); long getBlockSize(); void setBlockSize(long blockSize); int getBlockRestartInterval(); void setBlockRestartInterval(int blockRestartInterval);  }
@Test public void create_and_close() { LevelDBOptions options = new LevelDBOptions(); options.close(); }
@Test(expected = LevelDBException.class) public void create_and_close_twice() { LevelDBOptions options = new LevelDBOptions(); options.close(); options.close(); }