### Question:
AsyncResultHandler implements ResultHandler<T, CoreTokenException> { @SuppressWarnings("unchecked") public T getResults() throws CoreTokenException { try { Object value = syncQueue.poll(config.getQueueTimeout(), TimeUnit.SECONDS); if (value == null) { throw new CoreTokenException("Timed out whilst waiting for result"); } if (value.equals(NULL_SIGNAL)) { debug("Results: <null>"); return null; } if (value instanceof CoreTokenException) { throw (CoreTokenException) value; } if (value instanceof Exception) { final Exception ex = (Exception) value; throw new CoreTokenException(ex.getMessage(), ex); } debug("Results: {0}", value.toString()); return (T) value; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new CoreTokenException("Interrupted whilst waiting for a async operation", e); } } 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 (timeOut = 1000) public void shouldTimeoutIfNoResultsPublished() { given(mockConfig.getQueueTimeout()).willReturn(0); CoreTokenException error = null; try { handler.getResults(); } catch (CoreTokenException e) { error = e; } assertThat(error).isNotNull(); }