PharmacophoreAtom extends Atom { @Override public boolean equals(Object o) { if (!(o instanceof PharmacophoreAtom)) return false; PharmacophoreAtom that = (PharmacophoreAtom) o; return smarts.equals(that.getSmarts()) && symbol.equals(that.getSymbol()) && point3d.equals(that.getPoint3d()) && Arrays.equals(this.matchingAtoms, that.matchingAtoms); } PharmacophoreAtom(String smarts, String symbol, Point3d coordinates);  PharmacophoreAtom(PharmacophoreAtom pharmacophoreAtom); static PharmacophoreAtom get(IAtom atom); void setSmarts(String smarts); String getSmarts(); @Override void setSymbol(String symbol); @Override String getSymbol(); void setMatchingAtoms(int[] atomIndices); int[] getMatchingAtoms(); @Override int hashCode(); @Override boolean equals(Object o);  }
@Test public void testEquals() { PharmacophoreAtom patom1 = new PharmacophoreAtom("[CX2]N", "Amine", new Point3d(0, 0, 0)); patom1.setMatchingAtoms(new int[]{1, 4, 5}); PharmacophoreAtom patom2 = new PharmacophoreAtom("[CX2]N", "Amine", new Point3d(0, 0, 0)); patom2.setMatchingAtoms(new int[]{1, 4, 5}); PharmacophoreAtom patom3 = new PharmacophoreAtom("[CX2]N", "Amine", new Point3d(0, 1, 0)); patom3.setMatchingAtoms(new int[]{1, 4, 5}); PharmacophoreAtom patom4 = new PharmacophoreAtom("[CX2]N", "Amine", new Point3d(0, 0, 0)); patom4.setMatchingAtoms(new int[]{1, 4, 6}); Assert.assertEquals(patom2, patom1); Assert.assertNotSame(patom3, patom1); Assert.assertNotSame(patom4, patom1); }