### Question:
AbstractOAuthDataProvider implements OAuthDataProvider, ClientRegistrationProvider { @Override public ServerAccessToken createAccessToken(AccessTokenRegistration reg) throws OAuthServiceException { ServerAccessToken at = doCreateAccessToken(reg); saveAccessToken(at); if (isRefreshTokenSupported(reg.getApprovedScope())) { createNewRefreshToken(at); } return at; } protected  AbstractOAuthDataProvider(); @Override ServerAccessToken createAccessToken(AccessTokenRegistration reg); @Override ServerAccessToken refreshAccessToken(Client client, String refreshTokenKey,
                                                List<String> restrictedScopes); @Override void revokeToken(Client client, String tokenKey, String tokenTypeHint); @Override List<OAuthPermission> convertScopeToPermissions(Client client, List<String> requestedScopes); @Override ServerAccessToken getPreauthorizedToken(Client client,
                                                   List<String> requestedScopes,
                                                   UserSubject sub,
                                                   String grantType); void setAccessTokenLifetime(long accessTokenLifetime); void setRefreshTokenLifetime(long refreshTokenLifetime); void setRecycleRefreshTokens(boolean recycleRefreshTokens); boolean isRecycleRefreshTokens(); void init(); void close(); Map<String, OAuthPermission> getPermissionMap(); void setPermissionMap(Map<String, OAuthPermission> permissionMap); void setSupportedScopes(Map<String, String> scopes); MessageContext getMessageContext(); void setMessageContext(MessageContext messageContext); @Override Client removeClient(String clientId); @Override Client getClient(String clientId); void setAuthenticationStrategy(ProviderAuthenticationStrategy authenticationStrategy); List<String> getDefaultScopes(); void setDefaultScopes(List<String> defaultScopes); List<String> getRequiredScopes(); void setRequiredScopes(List<String> requiredScopes); List<String> getInvisibleToClientScopes(); void setInvisibleToClientScopes(List<String> invisibleToClientScopes); boolean isSupportPreauthorizedTokens(); void setSupportPreauthorizedTokens(boolean supportPreauthorizedTokens); void setClients(List<Client> clients); boolean isUseJwtFormatForAccessTokens(); void setUseJwtFormatForAccessTokens(boolean useJwtFormatForAccessTokens); OAuthJoseJwtProducer getJwtAccessTokenProducer(); void setJwtAccessTokenProducer(OAuthJoseJwtProducer jwtAccessTokenProducer); Map<String, String> getJwtAccessTokenClaimMap(); void setJwtAccessTokenClaimMap(Map<String, String> jwtAccessTokenClaimMap); boolean isPersistJwtEncoding(); void setPersistJwtEncoding(boolean persistJwtEncoding); String getIssuer(); void setIssuer(String issuer);  }### Answer:
@Test public void testAddGetDeleteMultipleAccessToken() { Client c = addClient("101", "bob"); AccessTokenRegistration atr = new AccessTokenRegistration(); atr.setClient(c); atr.setApprovedScope(Collections.singletonList("a")); atr.setSubject(c.getResourceOwnerSubject()); ServerAccessToken at = getProvider().createAccessToken(atr); validateAccessToken(at); at = getProvider().getAccessToken(at.getTokenKey()); validateAccessToken(at); AccessTokenRegistration atr2 = new AccessTokenRegistration(); atr2.setClient(c); atr2.setApprovedScope(Collections.singletonList("a")); atr2.setSubject(new TestingUserSubject(c.getResourceOwnerSubject().getLogin())); ServerAccessToken at2 = getProvider().createAccessToken(atr2); validateAccessToken(at2); at2 = getProvider().getAccessToken(at2.getTokenKey()); validateAccessToken(at2); assertNotNull(at.getSubject().getId()); assertTrue(at.getSubject() instanceof UserSubject); assertNotNull(at2.getSubject().getId()); assertTrue(at2.getSubject() instanceof TestingUserSubject); assertEquals(at.getSubject().getLogin(), at2.getSubject().getLogin()); assertNotEquals(at.getSubject().getId(), at2.getSubject().getId()); }