@Test
public void testOptionalFutureFailure() {

    FailedRequestException exception = new FailedRequestException("a tag", 500);
    CompletableFuture<Integer> future = new CompletableFuture<>();
    future.completeExceptionally(exception);
    CompletableFuture<Optional<Integer>> optFuture = FutureUtils.optionalFuture(future);
    expectFailedFuture(optFuture, exception);
}