### Question:
TaskDispatcher { public void read(String tokenId, ResultHandler<Token, ?> handler) throws CoreTokenException { Reject.ifNull(tokenId, handler); try { taskExecutor.execute(tokenId, taskFactory.read(tokenId, handler)); } catch (DataLayerException e) { throw new CoreTokenException("Error in data layer", e); } } @Inject  TaskDispatcher(@DataLayer(ConnectionType.CTS_ASYNC) TaskFactory taskFactory,
            @DataLayer(ConnectionType.CTS_ASYNC) TaskExecutor taskExecutor); synchronized void startDispatcher(); void create(Token token, ResultHandler<Token, ?> handler); void read(String tokenId, ResultHandler<Token, ?> handler); void update(Token token, ResultHandler<Token, ?> handler); void delete(String tokenId, ResultHandler<String, ?> handler); void query(TokenFilter tokenFilter, ResultHandler<Collection<Token>, ?> handler); void partialQuery(TokenFilter tokenFilter, ResultHandler<Collection<PartialToken>, ?> handler);  }### Answer:
@Test (expectedExceptions = NullPointerException.class) public void shouldRejectNullArgsOnRead() throws CoreTokenException { queue.read(null, null); }
@Test public void shouldRead() throws Exception { Task task = mock(Task.class); given(mockTaskFactory.read("123", mockHandler)).willReturn(task); queue.read("123", mockHandler); verify(mockExecutor).execute("123", task); }