Location { @Override public boolean equals(Object o) { if (o == null || this.getClass() != o.getClass()) { return false; } Location that = (Location) o; return this.latitude == that.latitude && this.longitude == that.longitude; } Location();  Location(double latitude, double longitude);  Location(Location location); static Location fromDegrees(double latitudeDegrees, double longitudeDegrees); static Location fromRadians(double latitudeRadians, double longitudeRadians); static Location fromTimeZone(TimeZone timeZone); static double normalizeLatitude(double degrees); static double normalizeLongitude(double degrees); static double clampLatitude(double degrees); static double clampLongitude(double degrees); static boolean locationsCrossAntimeridian(List<? extends Location> locations); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); Location set(double latitude, double longitude); Location set(Location location); Location interpolateAlongPath(Location endLocation, @WorldWind.PathType int pathType, double amount,
                                         Location result); double greatCircleAzimuth(Location location); double greatCircleDistance(Location location); Location greatCircleLocation(double azimuthDegrees, double distanceRadians, Location result); double rhumbAzimuth(Location location); double rhumbDistance(Location location); Location rhumbLocation(double azimuthDegrees, double distanceRadians, Location result); double linearAzimuth(Location location); double linearDistance(Location location); Location linearLocation(double azimuthDegrees, double distanceRadians, Location result); public double latitude; public double longitude; }
@Test public void testEquals() throws Exception { double lat = 34.2; double lon = -119.2; Location a = new Location(lat, lon); Location b = new Location(lat, lon); assertEquals("equality: latitude", b.latitude, a.latitude, 0); assertEquals("equality: longitude", b.longitude, a.longitude, 0); assertEquals("equality", a, a); assertEquals("equality", a, b); }