code: static <T, U> BiFunction<? super T, Throwable, ? extends U> returnOrThrow(
              Function<? super T, ? extends U> function) {
          return (result, cause) -> {
              throwUnsafelyIfNonNull(cause);
              return function.apply(result);
          };
      }
docs: Returns a {@link BiFunction} for a {@link CompletionStage#handle(BiFunction)} which returns an object
  applied by the specified {@code function} if the specified {@link Throwable} is {@code null}.
  Otherwise, it throws the {@code cause}.