code: @Override
      public void setAtoms(IAtom[] newAtoms) {
          // unregister this as listener with the old atoms
          for (int i = 0; i < atomCount; i++) {
              this.atoms[i].removeListener(this);
          }
          for (IAtom atom : newAtoms) {
              atom.addListener(this);
          }
          ensureAtomCapacity(newAtoms.length);
          System.arraycopy(newAtoms, 0, this.atoms, 0, newAtoms.length);
          if (newAtoms.length < this.atoms.length)
              Arrays.fill(atoms, newAtoms.length, this.atoms.length, null);
          this.atomCount = newAtoms.length;
          notifyChanged();
      }
docs: {@inheritDoc}