ChemModel extends ChemObject implements Serializable, IChemModel, IChemObjectListener, Cloneable { @Override public void setMoleculeSet(IAtomContainerSet setOfMolecules) { this.setOfMolecules = setOfMolecules; } ChemModel(); @Override IAtomContainerSet getMoleculeSet(); @Override void setMoleculeSet(IAtomContainerSet setOfMolecules); @Override IRingSet getRingSet(); @Override void setRingSet(IRingSet ringSet); @Override ICrystal getCrystal(); @Override void setCrystal(ICrystal crystal); @Override IReactionSet getReactionSet(); @Override void setReactionSet(IReactionSet sor); @Override String toString(); @Override Object clone(); @Override void stateChanged(IChemObjectChangeEvent event); @Override boolean isEmpty();  }
@Override @Test public void testStateChanged_EventPropagation_AtomContainerSet() { ChemObjectListener listener = new ChemObjectListener(); IChemModel chemObject = (IChemModel) newChemObject(); chemObject.addListener(listener); IAtomContainerSet molSet = chemObject.getBuilder().newInstance(IAtomContainerSet.class); chemObject.setMoleculeSet(molSet); Assert.assertFalse(listener.getChanged()); listener.reset(); Assert.assertFalse(listener.getChanged()); molSet.addAtomContainer(chemObject.getBuilder().newInstance(IAtomContainer.class)); Assert.assertFalse(listener.getChanged()); }
@Override @Test public void testStateChanged_ButNotAfterRemoval_AtomContainerSet() { ChemObjectListener listener = new ChemObjectListener(); IChemModel chemObject = (IChemModel) newChemObject(); chemObject.addListener(listener); IAtomContainerSet molSet = chemObject.getBuilder().newInstance(IAtomContainerSet.class); chemObject.setMoleculeSet(molSet); Assert.assertFalse(listener.getChanged()); chemObject.setMoleculeSet(null); listener.reset(); Assert.assertFalse(listener.getChanged()); molSet.addAtomContainer(chemObject.getBuilder().newInstance(IAtomContainer.class)); Assert.assertFalse(listener.getChanged()); }