### Question:
AsyncResultHandler implements ResultHandler<T, CoreTokenException> { public void processError(Exception error) { debug("Received: Error {0}", error.getMessage()); syncQueue.offer(error); } AsyncResultHandler(QueueConfiguration config, Debug debug);   AsyncResultHandler(QueueConfiguration config, BlockingQueue<Object> queue, Debug debug); @SuppressWarnings("unchecked") T getResults(); @Override void processResults(T result); void processError(Exception error);  }### Answer:
@Test public void shouldThrowExceptionProvided() { handler.processError(new CoreTokenException("Test")); assertThat(await(handler)).isInstanceOfAny(Throwable.class); }
@Test public void shouldWrapNonCoreTokenExceptions() { Exception ex = new Exception("test"); handler.processError(ex); Exception result = (Exception) await(handler); assertThat(result).isInstanceOf(CoreTokenException.class); assertThat(result.getCause()).isSameAs(ex); }