Point { static boolean arePointsClose(Point<? extends Number> pt1, Point<? extends Number> pt2, double distSqrd) { final double dx = pt1.x.doubleValue() - pt2.x.doubleValue(); final double dy = pt1.y.doubleValue() - pt2.y.doubleValue(); return dx * dx + dy * dy <= distSqrd; } protected  Point(Point<T> pt); protected  Point(T x, T y, T z); @Override boolean equals(Object obj); void set(Point<T> other); void setX(T x); void setY(T y); void setZ(T z); @Override String toString();  }
@Test public void arePointsCloseTest() { LongPoint pt1 = new LongPoint(1, 2); LongPoint pt2 = new LongPoint(0, 0); Assert.assertFalse(Point.arePointsClose(pt1, pt2, 4)); Assert.assertTrue(Point.arePointsClose(pt1, pt2, 5)); }