public static <T> CompletionStage<T> recover(CompletionStage<T> completionStage, Function<Throwable, T> exceptionHandler){
        return completionStage.exceptionally(exceptionHandler);
    }
@Test
    public void shouldThrowRuntimeException() {
        RuntimeException exception = new RuntimeException("blub");

        CompletableFuture<String> future = new CompletableFuture<>();
        future.completeExceptionally(exception);

        assertThatThrownBy(() -> recover(future, TimeoutException.class, (e) -> "fallback").toCompletableFuture()
            .get(1, TimeUnit.SECONDS))
            .hasCause(exception);
    }