Location { public Location set(double latitude, double longitude) { this.latitude = latitude; this.longitude = longitude; return this; } 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 testSet_WithDoubles() throws Exception { double lat = 34.2; double lon = -119.2; Location location = new Location(); location.set(lat, lon); assertEquals("latitude", lat, location.latitude, 0); assertEquals("longitude", lon, location.longitude, 0); }
@Test public void testSet() throws Exception { double lat = 34.2; double lon = -119.2; Location oxr = new Location(lat, lon); Location location = new Location(); location.set(oxr); assertEquals("latitude", oxr.latitude, location.latitude, 0); assertEquals("longitude", oxr.longitude, location.longitude, 0); }
@Test(expected = IllegalArgumentException.class) public void testSet_WithNull() throws Exception { Location location = new Location(); location.set(null); fail("Expected a InvalidArgumentException."); }