@Audit(action = AuditableActions.CHANGE_PASSWORD,
        actionResolverName = AuditActionResolvers.CHANGE_PASSWORD_ACTION_RESOLVER,
        resourceResolverName = AuditResourceResolvers.CHANGE_PASSWORD_RESOURCE_RESOLVER)
    @Override
    public boolean change(final PasswordChangeRequest bean) throws Throwable {
        if (passwordHistoryService != null && passwordHistoryService.exists(bean)) {
            LOGGER.debug("Password history policy disallows reusing the password for [{}]", bean.getUsername());
            return false;
        }
        if (changeInternal(bean)) {
            if (passwordHistoryService != null) {
                LOGGER.debug("Password successfully changed; storing used password in history for [{}]...", bean.getUsername());
                return passwordHistoryService.store(bean);
            }
            return true;
        }
        return false;
    }
This is {@link BasePasswordManagementService}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-pm-core/src/main/java/org/apereo/cas/pm/impl/BasePasswordManagementService.java