MultiDataWriter implements DataWriter<T> { @Override public Future<Void> saveAndIncrement(T data) { return comparators.map(c -> c.saveAndIncrement(data)) .foldLeft((acc, next) -> acc.zip(next, (v1, v2) -> v1)) .orElse(Future.ofResult(null)); }  @Override Future<T> loadAndGet(); @Override Future<Void> saveAndIncrement(T data); @Override Future<Boolean> isOutOfDate();  }
@Test public void emptySaveAndIncrement() { assertThat(empty.saveAndIncrement("hello world") .get(), equalTo(Try.success(null))); }