### Question:
AsyncResultHandler implements ResultHandler<T, CoreTokenException> { @Override public void processResults(T result) { debug("Received: results: {0}", result == null ? "<null>" : result.toString()); Object addition = result == null ? NULL_SIGNAL : result; if (syncQueue.offer(addition)) { return; } throw new IllegalStateException("Cannot add multiple times."); } 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 shouldReturnResultProvided() { handler.processResults(badger); assertThat(await(handler)).isEqualTo(badger); }
@Test public void shouldHandleNullObject() { handler.processResults(null); assertThat(await(handler)).isNull(); }
@Test (expectedExceptions = IllegalStateException.class) public void shouldNotAllowMultipleAdditionsToResultHandler() { handler.processResults("badger"); handler.processResults("weasel"); }