Point implements Comparable<Point> { public double distance(Point point) { return Math.sqrt( Math.pow(point.getX() - x, 2) + Math.pow(point.getY() - y, 2)); } 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 distanceTest() { Assert.assertEquals("Error calculating distance (PT1 -> PT5).", 5, testPoint1.distance(testPoint5), 0); Assert.assertEquals("Error calculating distance (PT5 -> PT1).", 5, testPoint5.distance(testPoint1), 0); Assert.assertEquals("Error calculating distance (PT1 -> PT2).", Math.sqrt(5), testPoint1.distance(testPoint2), 0); Assert.assertEquals("Error calculating distance (PT2 -> PT1).", Math.sqrt(5), testPoint2.distance(testPoint1), 0); Assert.assertEquals("Error calculating distance (PT1 -> PT1).", 0, testPoint1.distance(testPoint1), 0); Assert.assertEquals("Error calculating distance (PT2 -> PT3).", 0, testPoint2.distance(testPoint3), 0); Assert.assertEquals("Error calculating distance (PT3 -> PT2).", 0, testPoint3.distance(testPoint2), 0); Assert.assertEquals("Error calculating distance (PT1 -> PT4).", 0, testPoint1.distance(testPoint4), 0); Assert.assertEquals("Error calculating distance (PT4 -> PT1).", 0, testPoint4.distance(testPoint1), 0); }