class FutureUtils {

  public static void propagateCancellation(
      final CompletableFuture<?> from, final CompletableFuture<?> to) {
    from.exceptionally(
        error -> {
          if (error instanceof CancellationException) {
            to.cancel(true);
          }
          return null;
        });
  }

}