public boolean addAttachment(Attachment attachment) {
    boolean isExist = false;
    for (Attachment a : attachmentList) {
      if (a.getLabel().equalsIgnoreCase(attachment.getLabel())) {
        isExist = true;
      }
    }
    if (!isExist) {
      return attachmentList.add(attachment);
    }
    return false;
  }
public boolean addAttachment ( Attachment attachment ) { boolean isExist = false ; for ( Attachment a : attachmentList ) { if ( a . getLabel ( ) . equalsIgnoreCase ( attachment . getLabel ( ) ) ) { isExist = true ; } } if ( ! isExist ) { return attachmentList . add ( attachment ) ; } return false ; }
Try to add a new attachment to this monomer

@param attachment -- new attachment to be add in
@return true for success and false if there is one such attach point exist