### Question:
AbstractCachingAuthenticator extends AbstractAuthenticator<Principal> { protected void clearCache() { cache.invalidateAll(); } protected  AbstractCachingAuthenticator(long allowedTimestampSlop, long cacheTimeout, TimeUnit timeUnit, long maxCacheElements);   }### Answer:
@Test public void testClearCache() { Authenticator unit = new Authenticator(5000, 20); unit.authenticate(bCredentials); unit.authenticate(bCredentials); unit.authenticate(bCredentials); unit.clearCache(); unit.authenticate(bCredentials); unit.authenticate(bCredentials); assertEquals(2, unit.getNumLoads()); }