@Override
  public CacheAppender<O> newAppender() {
    return new JavaSerializationCacheAppender();
  }
@Test
  public void fail_to_serialize() throws Exception {
    class Unserializable implements Serializable {
      private void writeObject(ObjectOutputStream out) {
        throw new UnsupportedOperationException("expected error");
      }
    }
    DiskCache<Serializable> cache = new JavaSerializationDiskCache<>(temp.newFile(), System2.INSTANCE);
    try {
      cache.newAppender().append(new Unserializable());
      fail();
    } catch (UnsupportedOperationException e) {
      assertThat(e).hasMessage("expected error");
    }
  }