@Test
    public void testValidateAndExpire() {
        val authenticator = new
                LocalCachingAuthenticator(this.delegate, 10, 500, TimeUnit.MILLISECONDS);
        authenticator.init();

        authenticator.validate(null, this.credentials);
        assertTrue(authenticator.isCached(this.credentials));
        try {
            Thread.sleep(600);
        } catch (final InterruptedException e) {
            throw new RuntimeException(e);
        }
        assertFalse(authenticator.isCached(this.credentials));
    }
Test cases for {@link LocalCachingAuthenticator}.

@author Misagh Moayyed
@since 1.8
pac4j-core/src/test/java/org/pac4j/core/credentials/authenticator/LocalCachingAuthenticatorTests.java