code: @InterfaceAudience.Private
      protected void addAttachment(Attachment attachment, String name) {
          Map<String, Object> attachments = (Map<String, Object>) properties.get("_attachments");
          if (attachments == null) {
              attachments = new HashMap<String, Object>();
          }
          attachments.put(name, attachment);
          properties.put("_attachments", attachments);
          if (attachment != null) {
              attachment.setName(name);
          }
      }
docs: Creates or updates an attachment.
  The attachment data will be written to the database when the revision is saved.
  
  @param attachment A newly-created Attachment (not yet associated with any revision)
  @param name       The attachment name.