code: public boolean mutateAttachments(CollectionUtils.Functor<Map<String, Object>,
              Map<String, Object>> functor) {
          {
              Map<String, Object> properties = getProperties();
              Map<String, Object> editedProperties = null;
              Map<String, Object> attachments = (Map<String, Object>) properties.get("_attachments");
              Map<String, Object> editedAttachments = null;
              if (attachments != null) {
                  for (String name : attachments.keySet()) {
  
                      Map<String, Object> attachment = new HashMap<String, Object>(
                              (Map<String, Object>) attachments.get(name));
                      attachment.put("name", name);
                      Map<String, Object> editedAttachment = functor.invoke(attachment);
                      if (editedAttachment == null) {
                          return false;  // block canceled
                      }
                      if (editedAttachment != attachment) {
                          if (editedProperties == null) {
                              // Make the document properties and _attachments dictionary mutable:
                              editedProperties = new HashMap<String, Object>(properties);
                              editedAttachments = new HashMap<String, Object>(attachments);
                              editedProperties.put("_attachments", editedAttachments);
                          }
                          editedAttachment.remove("name");
                          editedAttachments.put(name, editedAttachment);
                      }
                  }
              }
              if (editedProperties != null) {
                  setProperties(editedProperties);
                  return true;
              }
              return false;
          }
      }
docs: Returns YES if any changes were made.