Point implements Comparable<Point> { @Override public boolean equals(Object object) { if (!(object instanceof Point)) { return false; } Point point = (Point) object; return (int) point.x == (int) this.x && (int) point.y == (int) this.y; } Point(double x, double y);  Point(Point point);  Point(String point); double getX(); double getY(); double distance(Point point); void moveToward(Point point, double distance); void pathToward(Point destination, double distance); boolean nextStep(Point point, double distance); @Override String toString(); String toNeatString(); @Override boolean equals(Object object); boolean lazyEquals(Object object); @Override int hashCode(); @Override int compareTo(Point point);  }
@Test public void equalsTest() { Assert.assertTrue("Error calculating equality (PT1 == PT4).", testPoint1.equals(testPoint4)); Assert.assertTrue("Error calculating equality (PT4 == PT1).", testPoint4.equals(testPoint1)); Assert.assertTrue("Error calculating equality (PT2 == PT3).", testPoint2.equals(testPoint3)); Assert.assertTrue("Error calculating equality (PT3 == PT2).", testPoint3.equals(testPoint2)); Assert.assertTrue("Error calculating equality (PT1 == PT1).", testPoint1.equals(testPoint1)); Assert.assertTrue("Error calculating equality (PT2 == PT2).", testPoint2.equals(testPoint2)); Assert.assertTrue("Error calculating equality (PT3 == PT3).", testPoint3.equals(testPoint3)); Assert.assertTrue("Error calculating equality (PT4 == PT4).", testPoint4.equals(testPoint4)); Assert.assertTrue("Error calculating equality (PT5 == PT5).", testPoint5.equals(testPoint5)); Assert.assertFalse("Error calculating equality (PT1 != PT5).", testPoint1.equals(testPoint5)); Assert.assertFalse("Error calculating equality (PT2 != PT5).", testPoint2.equals(testPoint5)); Assert.assertFalse("Error calculating equality (PT3 != PT5).", testPoint3.equals(testPoint5)); Assert.assertFalse("Error calculating equality (PT4 != PT5).", testPoint4.equals(testPoint5)); Assert.assertFalse("Error calculating equality (PT4 != (1, 3)).", testPoint2.equals(new Point(1, 3))); Assert.assertFalse("Error calculating equality (PT4 != (3, 2)).", testPoint2.equals(new Point(3, 2))); Assert.assertFalse("Error calculating equality (PT1 != ArrayList).", testPoint1.equals(new ArrayList<String>())); Assert.assertFalse("Error calculating equality (PT1 != HashMap).", testPoint1.equals(new HashMap<String, String>())); }