static @Nullable <V> V getWhenSuccessful(@Nullable CompletableFuture<V> future) {
    try {
      return (future == null) ? null : future.join();
    } catch (CancellationException | CompletionException e) {
      return null;
    }
  }
@Test(dataProvider = "unsuccessful")
  public void getWhenSuccessful_fails(CompletableFuture<?> future) {
    if ((future != null) && !future.isDone()) {
      var result = new AtomicInteger();
      ConcurrentTestHarness.execute(() -> {
        result.set(1);
        Object value = Async.getWhenSuccessful(future);
        result.set((value == null) ? 2 : 3);
      });
      await().untilAtomic(result, is(1));
      future.obtrudeException(new IllegalStateException());
      await().untilAtomic(result, is(not(1)));
      assertThat(result.get()).isEqualTo(2);
    }
    assertThat(Async.getWhenSuccessful(future)).isNull();
  }