@Test
  public void testPutAllWithNull() {
    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);

    List<Entry<byte[], byte[]>> deleteEntries = new ArrayList<>();
    for (int i = 0; i < 3; i++) {
      deleteEntries.add(new Entry<>(key(i), null));
    }
    this.inMemoryKeyValueStore.putAll(deleteEntries);

    for (int i = 0; i < 10; i++) {
      if (i < 3) {
        assertNull(this.inMemoryKeyValueStore.get(key(i)));
      } else {
        assertArrayEquals(value(i), this.inMemoryKeyValueStore.get(key(i)));
      }
    }
    // 10 times for "regular" puts, 3 times for deletion puts
    verify(this.putsCounter, times(13)).inc();
    // 10 "regular" puts all have same size for key/value
    verify(this.bytesWrittenCounter, times(10)).inc(DEFAULT_KEY_LENGTH + DEFAULT_VALUE_LENGTH);
    verifyNoMoreInteractions(this.bytesWrittenCounter);
    verify(this.deletesCounter, times(3)).inc();
  }
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