### Question:
ApiOAuth2TokenManager extends AbstractOAuthManager implements IApiOAuth2TokenManager { @Override public OAuth2AccessToken getAccessToken(OAuth2Authentication authentication) { String principal = authentication.getPrincipal().toString(); String clientId = authentication.getOAuth2Request().getClientId(); String grantType = authentication.getOAuth2Request().getGrantType(); return this.getAccessToken(principal, clientId, grantType); }  @Override void init(); @Override void destroy(); @Override OAuth2Authentication readAuthentication(OAuth2AccessToken token); @Override OAuth2Authentication readAuthentication(String tokenValue); @Override void storeAccessToken(OAuth2AccessToken accessToken, OAuth2Authentication authentication); @Override OAuth2AccessToken readAccessToken(String tokenValue); @Override void removeAccessToken(OAuth2AccessToken token); @Override void storeRefreshToken(OAuth2RefreshToken refreshToken, OAuth2Authentication authentication); @Override OAuth2RefreshToken readRefreshToken(String tokenValue); @Override OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken refreshToken); @Override void removeRefreshToken(OAuth2RefreshToken refreshToken); @Override void removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken); @Override OAuth2AccessToken createAccessTokenForLocalUser(String username); @Override OAuth2AccessToken getAccessToken(OAuth2Authentication authentication); @Override Collection<OAuth2AccessToken> findTokensByClientIdAndUserName(String clientId, String username); @Override Collection<OAuth2AccessToken> findTokensByUserName(String username); @Override Collection<OAuth2AccessToken> findTokensByClientId(String clientId); void setOAuth2TokenDAO(IOAuth2TokenDAO oAuth2TokenDAO);  }### Answer:
@Test public void getAccessToken() throws Exception { OAuth2AccessToken token = tokenManager.getAccessToken(this.createMockAuthentication()); Assert.assertNotNull(token); Assert.assertTrue(token instanceof OAuth2AccessTokenImpl); Assert.assertEquals("clientId", ((OAuth2AccessTokenImpl) token).getClientId()); Assert.assertEquals("username", ((OAuth2AccessTokenImpl) token).getLocalUser()); }