@Test
public void exceptionPassedToResult() throws Exception {

    final Exception exception = new Exception("Test exception!");
    Callable<Boolean> task = new Callable<Boolean>() {
        @Override
        public Boolean call() throws Exception {
            throw exception;
        }
    };
    Future<AsyncResult<Boolean>> resultFuture = AsyncRunner.submit(null, task);
    AsyncResult<Boolean> result = resultFuture.get();
    assertThat(result.getData(), is(nullValue()));
    assertThat(result.getException(), is(exception));
}