Projection p = Projections.getProjectionByCode(code);
EastNorth en = p.latlon2eastNorth(new LatLon(lat, lon));
String errorEN = String.format("%s (%s): Projecting latlon(%s,%s):%n" +
" expected: eastnorth(%s,%s),%n" +
" but got: eastnorth(%s,%s)!%n",
p.toString(), code, lat, lon, east, north, en.east(), en.north());
final double EPSILON_EN = SwissGridTest.SWISS_EPSG_CODE.equals(code)
? SwissGridTest.EPSILON_APPROX
: 1e-3; // 1 mm accuracy
if (Math.abs(east - en.east()) > EPSILON_EN || Math.abs(north - en.north()) > EPSILON_EN) {
fail.append(errorEN);