public double distanceToAsDouble(final IGeoPoint other) {
        final double lat1 = DEG2RAD * getLatitude();
        final double lat2 = DEG2RAD * other.getLatitude();
        final double lon1 = DEG2RAD * getLongitude();
        final double lon2 = DEG2RAD * other.getLongitude();
        return RADIUS_EARTH_METERS * 2 * Math.asin(Math.min(1, Math.sqrt(
                Math.pow(Math.sin((lat2 - lat1) / 2), 2)
                        + Math.cos(lat1) * Math.cos(lat2)
                        * Math.pow(Math.sin((lon2 - lon1) / 2), 2)
        )));
    }
@Test
    public void test_distanceTo_itself() {
        final double distancePrecisionDelta = 0;
        final int iterations = 100;
        for (int i = 0; i < iterations; i++) {
            final GeoPoint target = new GeoPoint(getRandomLatitude(), getRandomLongitude());
            final GeoPoint other = new GeoPoint(target);
            assertEquals("distance to self is zero for " + target, 0, target.distanceToAsDouble(other), distancePrecisionDelta);
            assertEquals("reverse distance to self is zero for " + other, 0, other.distanceToAsDouble(target), distancePrecisionDelta);
        }
    }