@Test public void sanity() { Future<Integer> success = dbAsync.submit(DB.unit(42)); SQLException ex = new SQLException("failed i have"); Future<Integer> fail = dbAsync.submit(DB.db((Try1<Connection, Integer, SQLException>) c -> { assertThat(c, is(notNullValue())); throw ex; })); assertThat(awaitAndGet(success), is(42)); assertThat(awaitAndGetFailure(fail), is(ex)); }