### Question:
FutureCallbackAdapter extends CompletableFuture<V> implements Callback<V> { @Override public void callException(Exception ex) { this.completeExceptionally(ex); }  @Override void call(V value); @Override void callException(Exception ex);  }### Answer:
@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()); } }