code: public void removeAttachment(IAtomBase toRemove) throws CTKException {
  
      Map<String, IAtomBase> groups = getRgroups();
      for (String key : groups.keySet()) {
  
        if (groups.get(key).compare(toRemove)) {
          for (int i = 0; i < attachments.size(); i++) {
            if (attachments.get(i).getLabel().equals(key)) {
              attachments.remove(i);
              break;
            }
          }
        }
      }
    }
docs: removes a given attachment from molecule
  
  @param toRemove a atom to be removed
  @throws CTKException general ChemToolKit exception passed to HELMToolKit