code: @Override
      public void add(IAtomContainer atomContainer) {
          if (atomContainer instanceof QueryAtomContainer) {
              for (int f = 0; f < atomContainer.getAtomCount(); f++) {
                  if (!contains(atomContainer.getAtom(f))) {
                      addAtom(atomContainer.getAtom(f));
                  }
              }
              for (int f = 0; f < atomContainer.getBondCount(); f++) {
                  if (!contains(atomContainer.getBond(f))) {
                      addBond(atomContainer.getBond(f));
                  }
              }
              for (int f = 0; f < atomContainer.getLonePairCount(); f++) {
                  if (!contains(atomContainer.getLonePair(f))) {
                      addLonePair(atomContainer.getLonePair(f));
                  }
              }
              for (int f = 0; f < atomContainer.getSingleElectronCount(); f++) {
                  if (!contains(atomContainer.getSingleElectron(f))) {
                      addSingleElectron(atomContainer.getSingleElectron(f));
                  }
              }
              notifyChanged();
          } else {
              throw new IllegalArgumentException("AtomContainer is not of type QueryAtomContainer");
          }
      }
docs: Adds all atoms and electronContainers of a given atomcontainer to this
  container.
  
  @param  atomContainer  The atomcontainer to be added