@Test
public void testFailedFuture()
{

    CompletableFuture<Object> future = failedFuture(new SQLException("foo"));
    assertTrue(future.isCompletedExceptionally());
    assertFailure(future::get, e -> {
        assertInstanceOf(e, ExecutionException.class);
        assertTrue(e.getCause() instanceof SQLException);
        assertEquals(e.getCause().getMessage(), "foo");
    });
}