### Question:
AbstractOAuthDataProvider implements OAuthDataProvider, ClientRegistrationProvider { @Override public Client removeClient(String clientId) { Client c = doGetClient(clientId); removeClientTokens(c); doRemoveClient(c); return c; } 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 testAddGetDeleteClients() { Client c = addClient("12345", "alice"); Client c2 = addClient("56789", "alice"); Client c3 = addClient("09876", "bob"); List<Client> aliceClients = getProvider().getClients(new UserSubject("alice")); assertNotNull(aliceClients); assertEquals(2, aliceClients.size()); compareClients(c, "12345".equals(aliceClients.get(0).getClientId()) ? aliceClients.get(0) : aliceClients.get(1)); compareClients(c2, "56789".equals(aliceClients.get(0).getClientId()) ? aliceClients.get(0) : aliceClients.get(1)); List<Client> bobClients = getProvider().getClients(new UserSubject("bob")); assertNotNull(bobClients); assertEquals(1, bobClients.size()); Client bobClient = bobClients.get(0); compareClients(c3, bobClient); List<Client> allClients = getProvider().getClients(null); assertNotNull(allClients); assertEquals(3, allClients.size()); getProvider().removeClient(c.getClientId()); getProvider().removeClient(c2.getClientId()); getProvider().removeClient(c3.getClientId()); allClients = getProvider().getClients(null); assertNotNull(allClients); assertEquals(0, allClients.size()); }