InMemoryKeyValueStore implements KeyValueStore<byte[], byte[]> { @Override public void delete(byte[] key) { metrics.deletes().inc(); put(key, null); } InMemoryKeyValueStore(KeyValueStoreMetrics metrics); @Override byte[] get(byte[] key); @Override void put(byte[] key, byte[] value); @Override void putAll(List<Entry<byte[], byte[]>> entries); @Override void delete(byte[] key); @Override KeyValueIterator<byte[], byte[]> range(byte[] from, byte[] to); @Override KeyValueSnapshot<byte[], byte[]> snapshot(byte[] from, byte[] to); @Override KeyValueIterator<byte[], byte[]> all(); @Override Optional<Path> checkpoint(CheckpointId id); @Override void flush(); @Override void close();  }
@Test public void testDelete() { this.inMemoryKeyValueStore.put(key(0), value(0)); this.inMemoryKeyValueStore.delete(key(0)); assertNull(this.inMemoryKeyValueStore.get(key(0))); verify(this.deletesCounter, times(2)).inc(); }