class SafeFuture extends CompletableFuture<T> {

  public void propagateToAsync(final SafeFuture<T> target, final AsyncRunner asyncRunner) {
    finish(
        result -> asyncRunner.runAsync(() -> target.complete(result)).reportExceptions(),
        error ->
            asyncRunner.runAsync(() -> target.completeExceptionally(error)).reportExceptions());
  }

}