code: public static boolean executeModifyOperation(final String currentDn, final ConnectionFactory connectionFactory,
                                                   final Map<String, Set<String>> attributes) {
          try (val modifyConnection = createConnection(connectionFactory)) {
              val operation = new ModifyOperation(modifyConnection);
              val mods = attributes.entrySet()
                  .stream()
                  .map(entry -> {
                      val values = entry.getValue().toArray(ArrayUtils.EMPTY_STRING_ARRAY);
                      val attr = new LdapAttribute(entry.getKey(), values);
                      return new AttributeModification(AttributeModificationType.REPLACE, attr);
                  })
                  .toArray(value -> new AttributeModification[attributes.size()]);
              val request = new ModifyRequest(currentDn, mods);
              request.setReferralHandler(new ModifyReferralHandler());
              operation.execute(request);
              return true;
          } catch (final LdapException e) {
              LOGGER.error(e.getMessage(), e);
          }
          return false;
      }
docs: Execute modify operation boolean.
  
  @param currentDn         the current dn
  @param connectionFactory the connection factory
  @param attributes        the attributes
  @return true/false