@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();
    // when using key(i) and value(i), the byte[] lengths will be the same
    verify(this.bytesWrittenCounter, times(10)).inc(DEFAULT_KEY_LENGTH + DEFAULT_VALUE_LENGTH);
  }
The length of the result of {@link #value(int)} will always be the same, so this can be used as the length for any
key produced by {@link #value(int)}.
samza-kv-inmemory/src/test/java/org/apache/samza/storage/kv/inmemory/TestInMemoryKeyValueStore.java