### Question:
DENOPTIMAttachmentPoint implements Serializable { public boolean equals(DENOPTIMAttachmentPoint other) { if (this.getAtomPositionNumber() != other.getAtomPositionNumber()) { return false; } if (this.getAtmConnections() != other.getAtmConnections()) { return false; } if (this.getAPConnections() != other.getAPConnections()) { return false; } if (this.getAPClass()!=null && other.getAPClass()!=null) { if (!this.getAPClass().equals(other.getAPClass())) { return false; } } if (this.getAPRule()!=null && other.getAPRule()!=null) { if (!this.getAPRule().equals(other.getAPRule())) { return false; } } if (this.getAPSubClass() != other.getAPSubClass()) { return false; } if (this.getDirectionVector()!=null && other.getDirectionVector()!=null) { double trslh = 0.001; if (Math.abs(this.getDirectionVector()[0] -other.getDirectionVector()[0]) > trslh) { return false; } if (Math.abs(this.getDirectionVector()[1] -other.getDirectionVector()[1]) > trslh) { return false; } if (Math.abs(this.getDirectionVector()[2] -other.getDirectionVector()[2]) > trslh) { return false; } } return true; } DENOPTIMAttachmentPoint();  DENOPTIMAttachmentPoint(int m_AtomPosNum, int m_atomConnections,
                                                            int m_apConnections);  DENOPTIMAttachmentPoint(int m_AtomPosNum, int m_atomConnections,
                                        int m_apConnections, double[] m_dirVec);  DENOPTIMAttachmentPoint(String str, String format); int getAtmConnections(); int getAPConnections(); int getAtomPositionNumber(); void setAtomPositionNumber(int m_atomPostionNumber); void setAPConnections(int m_apConnections); void setDirectionVector(double[] m_dirVec); void setAPClass(String m_class); static boolean isValidAPClassString(String temptAPClass); String getAPClass(); int getAPSubClass(); String getAPRule(); double[] getDirectionVector(); void resetAPConnections(); void updateAPConnections(int delta); boolean isAvailable(); boolean isClassEnabled(); int compareTo(DENOPTIMAttachmentPoint other); boolean equals(DENOPTIMAttachmentPoint other); String getSingleAPStringSDF(boolean isFirst); @Override String toString();  }### Answer:
@Test public void testEquals() throws Exception { DENOPTIMAttachmentPoint apA = new DENOPTIMAttachmentPoint(1, 2, 1); DENOPTIMAttachmentPoint apB = new DENOPTIMAttachmentPoint(1, 2, 1); assertEquals(apA.compareTo(apB),0); assertTrue(apA.equals(apB)); }
@Test public void testEquals_DiffArcAtm() throws Exception { DENOPTIMAttachmentPoint apA = new DENOPTIMAttachmentPoint(1, 2, 1); DENOPTIMAttachmentPoint apB = new DENOPTIMAttachmentPoint(2, 2, 1); assertFalse(apA.equals(apB)); }