@Override
    public void updateSecurityQuestions(final PasswordManagementQuery query) {
        findEntries(CollectionUtils.wrap(query.getUsername()))
            .forEach((entry, ldap) -> {
                LOGGER.debug("Located LDAP entry [{}] in the response", entry);
                val questionsAndAnswers = new ArrayDeque<>(ldap.getSecurityQuestionsAttributes().entrySet());
                LOGGER.debug("Security question attributes are defined to be [{}]", questionsAndAnswers);
                val ldapConnectionFactory = new LdapConnectionFactory(connectionFactoryMap.get(ldap.getLdapUrl()));

                val attributes = new LinkedHashMap<String, Set<String>>();
                query.getSecurityQuestions().forEach((question, answers) -> {
                    val attrEntry = questionsAndAnswers.pop();
                    attributes.put(attrEntry.getKey(), Set.of(question));
                    attributes.put(attrEntry.getValue(), Set.copyOf(answers));
                });
                ldapConnectionFactory.executeModifyOperation(entry.getDn(), attributes);
            });
    }
This is {@link LdapPasswordManagementService}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-pm-ldap/src/main/java/org/apereo/cas/pm/LdapPasswordManagementService.java