### Question:
RDBStore implements DBStore { @VisibleForTesting public RocksDB getDb() { return db; } @VisibleForTesting  RDBStore(File dbFile, DBOptions options,
                  Set<TableConfig> families);  RDBStore(File dbFile, DBOptions options,
      WriteOptions writeOptions, Set<TableConfig> families,
                  CodecRegistry registry); static IOException toIOException(String msg, RocksDBException e); @Override void compactDB(); @Override void close(); @Override void move(K key, Table<K, V> source,
                                Table<K, V> dest); @Override void move(K key, V value, Table<K, V> source,
                                Table<K, V> dest); @Override void move(K sourceKey, K destKey, V value,
                                Table<K, V> source,
                                Table<K, V> dest); @Override long getEstimatedKeyCount(); @Override BatchOperation initBatchOperation(); @Override void commitBatchOperation(BatchOperation operation); @Override Table<byte[], byte[]> getTable(String name); @Override Table<K, V> getTable(String name,
      Class<K> keyType, Class<V> valueType); @Override Table<K, V> getTable(String name,
      Class<K> keyType, Class<V> valueType,
      TableCacheImpl.CacheCleanupPolicy cleanupPolicy); @Override ArrayList<Table> listTables(); @Override void flushDB(); @Override void flushLog(boolean sync); @Override DBCheckpoint getCheckpoint(boolean flush); @Override File getDbLocation(); @Override Map<Integer, String> getTableNames(); @Override CodecRegistry getCodecRegistry(); @Override DBUpdatesWrapper getUpdatesSince(long sequenceNumber); @VisibleForTesting RocksDB getDb(); RDBMetrics getMetrics();  }### Answer:
@Test public void testRocksDBKeyMayExistApi() throws Exception { try (RDBStore newStore = new RDBStore(folder.newFolder(), options, configSet)) { RocksDB db = newStore.getDb(); long start = System.nanoTime(); for (int i = 0; i < 50; i++) { Assert.assertTrue(db.get( org.apache.commons.codec.binary.StringUtils .getBytesUtf16("key" + i)) == null); } long end = System.nanoTime(); long keyGetLatency = end - start; start = System.nanoTime(); for (int i = 0; i < 50; i++) { Assert.assertFalse(db.keyMayExist( org.apache.commons.codec.binary.StringUtils .getBytesUtf16("key" + i), null)); } end = System.nanoTime(); long keyMayExistLatency = end - start; Assert.assertTrue(keyMayExistLatency < keyGetLatency); } }