@Test
    void verifyValidity() throws Throwable {
        passwordHistoryService.removeAll();
        assertTrue(passwordHistoryService.fetchAll().isEmpty());

        val request = new PasswordChangeRequest("casuser", "current-psw".toCharArray(),
            "123456".toCharArray(), "123456".toCharArray());
        assertFalse(passwordHistoryService.exists(request));
        assertTrue(passwordHistoryService.store(request));
        assertTrue(passwordHistoryService.exists(request));
        assertFalse(passwordHistoryService.fetchAll().isEmpty());
        assertFalse(passwordHistoryService.fetch("casuser").isEmpty());

        passwordHistoryService.remove("casuser");
        assertTrue(passwordHistoryService.fetch("casuser").isEmpty());
    }
This is {@link InMemoryPasswordHistoryServiceTests}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-pm/src/test/java/org/apereo/cas/pm/history/InMemoryPasswordHistoryServiceTests.java