@Test
public void exceptionTest() throws Exception {

    FutureCallbackAdapter<String> f = new FutureCallbackAdapter<>();
    assertFalse(f.isDone());
    f.callException(new Exception("test"));
    assertTrue(f.isDone());
    try {
        f.get();
    } catch (ExecutionException ex) {
        assertEquals("test", ex.getCause().getMessage());
    }
    try {
        f.get(1, TimeUnit.SECONDS);
    } catch (ExecutionException ex) {
        assertEquals("test", ex.getCause().getMessage());
    }
}