static @Nullable <V> V getWhenSuccessful(@Nullable CompletableFuture<V> future) {
    try {
      return (future == null) ? null : future.join();
    } catch (CancellationException | CompletionException e) {
      return null;
    }
  }
@Test(dataProvider = "successful")
  public void getWhenSuccessful_success(CompletableFuture<Integer> future) {
    assertThat(Async.getWhenSuccessful(future)).isEqualTo(1);
  }