LevelDBWriteBatch implements AutoCloseable { public void clear() { checkWriteBatchOpen(); LevelDBNative.leveldb_writebatch_clear(writeBatch); } LevelDBWriteBatch(); @Override void close(); void clear(); void put(byte[] key, byte[] value); void delete(byte[] key);  }
@Test public void clear() { try(LevelDBWriteBatch writeBatch = new LevelDBWriteBatch()) { writeBatch.clear(); } }