Element extends ChemObject implements Serializable, IElement, Cloneable { @Override public boolean compare(Object object) { if (!(object instanceof Element)) { return false; } if (!super.compare(object)) { return false; } Element elem = (Element) object; return Objects.equal(atomicNumber, elem.atomicNumber); } Element();  Element(IElement element);  Element(String symbol);  Element(String symbol, Integer atomicNumber); @Override Integer getAtomicNumber(); @Override void setAtomicNumber(Integer atomicNumber); @Override String getSymbol(); @Override void setSymbol(String symbol); @Override String toString(); @Override Object clone(); @Override boolean compare(Object object);  }
@Test public void compareSymbol() { Element e1 = new Element(new String("H"), 1); Element e2 = new Element(new String("H"), 1); Assert.assertTrue(e1.compare(e2)); }
@Test public void compareAtomicNumber() { Element e1 = new Element("H", new Integer(1)); Element e2 = new Element("H", new Integer(1)); Assert.assertTrue(e1.compare(e2)); }
@Test public void compareDiffSymbol() { Element e1 = new Element(new String("H"), 1); Element e2 = new Element(new String("C"), 12); Assert.assertFalse(e1.compare(e2)); }
@Test public void compareDiffAtomicNumber() { Element e1 = new Element(new String("H"), 1); Element e2 = new Element(new String("H"), null); Assert.assertFalse(e1.compare(e2)); }