// Converts a Coordinates object to a LatLng object public static LatLng coordinatesToLatLng(Coordinates coordinates) { LatLng latLng = null; if (coordinates != null) { latLng = new LatLng(coordinates.getLatitude(), coordinates.getLongitude()); } return latLng; }
@Test public void givenLocationInAngle_CanRetrieveTheLongitude() { Angle latitude = Angle.fromDegrees(39.54); Angle longitude = Angle.fromDegrees(-54.76); Coordinates location = Coordinates.locatedAt(latitude, longitude); assertThat(location.getLongitude()).isEqualTo(longitude); }
@Test public void givenNumericLocation_CanRetrieveTheLongitude() { Coordinates location = Coordinates.locatedAt(45.34, -73.45); assertThat(location.getLongitude()).isEqualTo(Angle.fromDegrees(-73.45)); }