public static LatLong interpolateLatLong(LatLong p1, LatLong p2, double fraction) {

        double maxLat = max(p1.latitude(), p2.latitude());
        double minLat = min(p1.latitude(), p2.latitude());
        checkArgument(maxLat - minLat <= 90.0, "Interpolation is unsafe at this distance (latitude)");

        double maxLong = max(p1.longitude(), p2.longitude());
        double minLong = min(p1.longitude(), p2.longitude());
        checkArgument(maxLong - minLong <= 180.0, "Interpolation is unsafe at this distance (longitude)");

        return new LatLong(
            interpolate(p1.latitude(), p2.latitude(), fraction),
            interpolate(p1.longitude(), p2.longitude(), fraction)
        );
    }
@Test
    public void testUnsafeInterpolateLatLongFails() {

        LatLong p1 = new LatLong(89.0, 0.0);
        LatLong p2 = new LatLong(-89.0, 0.0);

        try {
            interpolateLatLong(p1, p2, 0.5);
            fail("This call should fail until the implementation is improved");
        } catch (IllegalArgumentException iae) {
            assertTrue(iae.getMessage().contains("Interpolation is unsafe at this distance (latitude)"));
        }

        LatLong p3 = new LatLong(0.0, -178.0);
        LatLong p4 = new LatLong(0.0, 178.0);

        try {
            interpolateLatLong(p3, p4, 0.5);
            fail("This call should fail until the implementation is improved");
        } catch (IllegalArgumentException iae) {
            assertTrue(iae.getMessage().contains("Interpolation is unsafe at this distance (longitude)"));
        }
    }