### Question:
CoreTokenAdapter { public Token read(String tokenId) throws CoreTokenException { debug("Read: queued {0}", tokenId); ResultHandler<Token, CoreTokenException> handler = handlerFactory.getReadHandler(); dispatcher.read(tokenId, handler); try { Token token = handler.getResults(); if (token == null) { debug("Read: no Token found for {0}", tokenId); } else { reverseBlobStrategy(token); debug("Read: returned for {0}\n{1}", tokenId, token); } return token; } catch (CoreTokenException e) { throw new ReadFailedException(tokenId, e); } } @Inject  CoreTokenAdapter(TokenBlobStrategy strategy, TaskDispatcher dispatcher, ResultHandlerFactory handlerFactory,
                            CTSReaperInit reaperInit, @Named(CoreTokenConstants.CTS_DEBUG) Debug debug); ResultHandler<Token, CoreTokenException> create(Token token); Token read(String tokenId); ResultHandler<Token, CoreTokenException> updateOrCreate(Token token); ResultHandler<String, CoreTokenException> delete(String tokenId); Collection<Token> query(final TokenFilter tokenFilter); Collection<PartialToken> attributeQuery(final TokenFilter filter); void deleteOnQuery(final TokenFilter filter);  }### Answer:
@SuppressWarnings("unchecked") @Test public void shouldReadToken() throws Exception { String tokenId = "badger"; Token token = new Token(tokenId, TokenType.SESSION); ResultHandler<Token, CoreTokenException> mockResultHandler = mock(ResultHandler.class); given(mockResultHandler.getResults()).willReturn(token); given(mockResultHandlerFactory.getReadHandler()).willReturn(mockResultHandler); Token result = adapter.read(tokenId); assertThat(result.getTokenId()).isEqualTo(tokenId); }