AtomType extends Isotope implements IAtomType, Serializable, Cloneable { @Override public boolean compare(Object object) { if (!(object instanceof IAtomType)) { return false; } if (!super.compare(object)) { return false; } AtomType type = (AtomType) object; return Objects.equal(getAtomTypeName(), type.getAtomTypeName()) && Objects.equal(maxBondOrder, type.maxBondOrder) && Objects.equal(bondOrderSum, type.bondOrderSum); } AtomType(String elementSymbol);  AtomType(String identifier, String elementSymbol);  AtomType(IElement element); @Override void setAtomTypeName(String identifier); @Override void setMaxBondOrder(IBond.Order maxBondOrder); @Override void setBondOrderSum(Double bondOrderSum); @Override String getAtomTypeName(); @Override IBond.Order getMaxBondOrder(); @Override Double getBondOrderSum(); @Override void setFormalCharge(Integer charge); @Override Integer getFormalCharge(); @Override void setFormalNeighbourCount(Integer count); @Override Integer getFormalNeighbourCount(); @Override void setHybridization(IAtomType.Hybridization hybridization); @Override IAtomType.Hybridization getHybridization(); @Override boolean compare(Object object); @Override void setCovalentRadius(Double radius); @Override Double getCovalentRadius(); @Override void setValency(Integer valency); @Override Integer getValency(); @Override Object clone(); @Override String toString();  }
@Test public void testCompare() { IAtomType at = new AtomType("C4", "C"); if (at instanceof org.openscience.cdk.AtomType) { org.openscience.cdk.AtomType at1 = (org.openscience.cdk.AtomType) at; IAtomType at2 = at.getBuilder().newInstance(IAtomType.class, "C3", "C"); Assert.assertFalse(at1.compare("C4")); Assert.assertFalse(at1.compare(at2)); } }
@Test @Override public void testCompare_Object() { IAtomType someAt = new AtomType("C"); if (someAt instanceof org.openscience.cdk.AtomType) { org.openscience.cdk.AtomType at = (org.openscience.cdk.AtomType) someAt; Assert.assertTrue(at.compare(at)); IAtomType hydrogen = someAt.getBuilder().newInstance(IAtomType.class, "H"); Assert.assertFalse(at.compare(hydrogen)); Assert.assertFalse(at.compare("Li")); } }