Position extends Location { public Position set(double latitude, double longitude, double altitude) { this.latitude = latitude; this.longitude = longitude; this.altitude = altitude; return this; } Position();  Position(double latitude, double longitude, double altitude);  Position(Position position); static Position fromDegrees(double latitudeDegrees, double longitudeDegrees, double altitude); static Position fromRadians(double latitudeRadians, double longitudeRadians, double altitude); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); Position set(double latitude, double longitude, double altitude); Position set(Position position); Position interpolateAlongPath(Position endPosition, @WorldWind.PathType int pathType, double amount,
                                         Position result); public double altitude; }
@Test public void testSet() throws Exception { double lat = 34.2; double lon = -119.2; double elev = 13.7; Position oxr = new Position(lat, lon, elev); Position other = new Position(); other.set(oxr); assertEquals("latitude", oxr.latitude, other.latitude, 0); assertEquals("longitude", oxr.longitude, other.longitude, 0); assertEquals("altitude", oxr.altitude, other.altitude, 0); }
@Test public void testSet_WithDoubles() throws Exception { double lat = 34.2; double lon = -119.2; double elev = 13.7; Position pos = new Position(); pos.set(lat, lon, elev); assertEquals("latitude", lat, pos.latitude, 0); assertEquals("longitude", lon, pos.longitude, 0); assertEquals("altitude", elev, pos.altitude, 0); }
@Test(expected = IllegalArgumentException.class) public void testSet_WithNull() throws Exception { Position position = new Position(); position.set(null); fail("Expected a InvalidArgumentException."); }