@Override
  public void write(String key, InputStream data) {
    checkNotNull(data);
    try {
      write(key, data.readAllBytes());
    } catch (IOException e) {
      throw new IllegalStateException("Failed to read sensor write cache data", e);
    }
  }
@Test
  public void write_inputStream_adds_entries()  {
    byte[] b1 = new byte[] {1, 2, 3};
    byte[] b2 = new byte[] {3, 4};
    writeCache.write("key", new ByteArrayInputStream(b1));
    writeCache.write("key2", new ByteArrayInputStream(b2));

    assertThatCacheContains(Map.of("key", b1, "key2", b2));
  }