### Question:
AbstractOAuth2TokenService implements OAuth2TokenService, Cacheable { @Override public Object getCacheStatistics() { return getCacheConfiguration().isCacheStatisticsEnabled() ? responseCache.stats() : null; } AbstractOAuth2TokenService();  AbstractOAuth2TokenService(TokenCacheConfiguration tokenCacheConfiguration);   AbstractOAuth2TokenService(TokenCacheConfiguration tokenCacheConfiguration, Ticker cacheTicker,
			boolean sameThreadCache); @Override void clearCache(); @Override @Nonnull TokenCacheConfiguration getCacheConfiguration(); @Override OAuth2TokenResponse retrieveAccessTokenViaClientCredentialsGrant(@Nonnull URI tokenEndpointUri,
			@Nonnull ClientCredentials clientCredentials,
			@Nullable String subdomain, @Nullable Map<String, String> optionalParameters,
			boolean disableCacheForRequest); @Override OAuth2TokenResponse retrieveAccessTokenViaUserTokenGrant(@Nonnull URI tokenEndpointUri,
			@Nonnull ClientCredentials clientCredentials, @Nonnull String token, @Nullable String subdomain,
			@Nullable Map<String, String> optionalParameters); @Override OAuth2TokenResponse retrieveAccessTokenViaRefreshToken(@Nonnull URI tokenEndpointUri,
			@Nonnull ClientCredentials clientCredentials,
			@Nonnull String refreshToken, String subdomain, boolean disableCacheForRequest); @Override OAuth2TokenResponse retrieveAccessTokenViaPasswordGrant(@Nonnull URI tokenEndpoint,
			@Nonnull ClientCredentials clientCredentials, @Nonnull String username, @Nonnull String password,
			@Nullable String subdomain, @Nullable Map<String, String> optionalParameters,
			boolean disableCacheForRequest); @Override OAuth2TokenResponse retrieveAccessTokenViaJwtBearerTokenGrant(URI tokenEndpoint,
			ClientCredentials clientCredentials, String token, @Nullable String subdomain,
			@Nullable Map<String, String> optionalParameters, boolean disableCacheForRequest); @Override Object getCacheStatistics();  }### Answer:
@Test public void cacheStatistics_isDisabled_statisticsObjectIsNull() { TokenCacheConfiguration tokenCacheConfiguration = cacheConfigurationWithCacheStatistics(false); cut = new TestOAuth2TokenService(tokenCacheConfiguration); assertThat(cut.getCacheStatistics()).isNull(); }
@Test public void cacheStatistics_isEnabled_returnsStatisticsObject() { TokenCacheConfiguration tokenCacheConfiguration = cacheConfigurationWithCacheStatistics(true); cut = new TestOAuth2TokenService(tokenCacheConfiguration); assertThat(cut.getCacheStatistics()).isInstanceOf(CacheStats.class); }