public boolean executeModifyOperation(final String currentDn,
                                          final Map<String, ? extends Set<String>> attributes) {
        return FunctionUtils.doAndHandle(() -> {
            val operation = new ModifyOperation(connectionFactory);
            val mods = attributes.entrySet()
                .stream()
                .map(entry -> {
                    val values = entry.getValue().toArray(ArrayUtils.EMPTY_STRING_ARRAY);
                    val attr = new LdapAttribute(entry.getKey(), values);
                    LOGGER.debug("Constructed new attribute [{}]", attr);
                    return new AttributeModification(AttributeModification.Type.REPLACE, attr);
                })
                .toArray(AttributeModification[]::new);
            val request = new ModifyRequest(currentDn, mods);
            val response = operation.execute(request);
            LOGGER.debug("Result code [{}], message: [{}]", response.getResultCode(), response.getDiagnosticMessage());
            return response.getResultCode() == ResultCode.SUCCESS;
        }, e -> false).get();
    }
Execute modify operation.

@param currentDn  the current dn
@param attributes the attributes
@return true/false
support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapConnectionFactory.java