@Override
  public void copyFromPrevious(String key) {
    checkArgument(readCache.contains(key), "Previous cache doesn't contain key '%s'", key);
    write(key, readCache.read(key));
  }
@Test
  public void copyFromPrevious_reads_from_readCache() throws IOException {
    byte[] b = new byte[] {1};
    InputStream value = new ByteArrayInputStream(b);
    when(readCache.contains("key")).thenReturn(true);
    when(readCache.read("key")).thenReturn(value);
    writeCache.copyFromPrevious("key");

    assertThatCacheContains(Map.of("key", b));
  }