### Question:
EPoint extends Point2D implements Serializable { public double gridDistance(EPoint pt) { long PX = pt.getGridX() - this.getGridX(); long PY = pt.getGridY() - this.getGridY(); return PY == 0 ? Math.abs(PX) : PX == 0 ? Math.abs(PY) : Math.hypot(PX, PY); } EPoint(double lambdaX, double lambdaY); private  EPoint(long gridX, long gridY); static EPoint fromLambda(double lambdaX, double lambdaY); static EPoint fromGrid(long gridX, long gridY); static EPoint snap(Point2D p); @Override double getX(); @Override double getY(); double getLambdaX(); double getLambdaY(); long getGridX(); long getGridY(); @Override void setLocation(double x, double y); Point2D.Double lambdaMutable(); Point2D.Double gridMutable(); double lambdaDistance(EPoint pt); double gridDistance(EPoint pt); boolean isSmall(); boolean equals(EPoint that); String toString(); static void printStatistics(); static final EPoint ORIGIN; }### Answer:
@Test public void testGridDistance() { System.out.println("gridDistance"); assertEquals(Math.sqrt(500), p0.gridDistance(EPoint.ORIGIN), 0); }