private void doNearestPointsTest(String wkt0, String wkt1, double distance,
Coordinate p0, Coordinate p1) throws ParseException {
DistanceOp op = new DistanceOp(new WKTReader().read(wkt0), new WKTReader().read(wkt1));
double tolerance = 1E-10;
assertEquals(distance, op.nearestPoints()[0].distance(op.nearestPoints()[1]), tolerance);
assertEquals(p0.x, op.nearestPoints()[0].x, tolerance);
assertEquals(p0.y, op.nearestPoints()[0].y, tolerance);
assertEquals(p1.x, op.nearestPoints()[1].x, tolerance);
assertEquals(p1.y, op.nearestPoints()[1].y, tolerance);
}