@Test(expected = IllegalStateException.class)
public void passExceptionCorrectly() throws Throwable {

    AtomicReference<Throwable> exceptionResult = new AtomicReference<>();
    Future<Boolean> origin = new FutureWithSource<>(null, exceptionResult);
    CompletableFuture<Boolean> shift = Futurity.shift(origin);
    assertFalse(shift.isDone());
    Throwable ex = new IllegalStateException();
    exceptionResult.set(ex);
    await().pollInterval(1, TimeUnit.MILLISECONDS).pollDelay(0, TimeUnit.MILLISECONDS)
           .atMost(1, TimeUnit.SECONDS).until(shift::isDone);
    try {
        shift.get();
    } catch (ExecutionException e) {
        Throwable ex1 = e.getCause();
        assertSame(ex1, ex);
        throw ex1;
    }
    fail();
}