InMemoryKeyValueStore implements KeyValueStore<byte[], byte[]> { @Override public void putAll(List<Entry<byte[], byte[]>> entries) { for (Entry<byte[], byte[]> next : entries) { put(next.getKey(), next.getValue()); } } 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 testPutAll() { List<Entry<byte[], byte[]>> entries = new ArrayList<>(); for (int i = 0; i < 10; i++) { entries.add(new Entry<>(key(i), value(i))); } this.inMemoryKeyValueStore.putAll(entries); for (int i = 0; i < 10; i++) { assertArrayEquals(value(i), this.inMemoryKeyValueStore.get(key(i))); } verify(this.putsCounter, times(10)).inc(); verify(this.bytesWrittenCounter, times(10)).inc(DEFAULT_KEY_LENGTH + DEFAULT_VALUE_LENGTH); }