BoundingBox { public static double getLongitude(double longitude) { longitude = (longitude + 180) % 360 - 180; while (longitude < -180) { longitude += 360; } return longitude; } protected  BoundingBox(double north, double east, double south, double west); static BoundingBox fromWestSouthEastNorthArray(String[] bbox); static BoundingBox fromWSEN(double west, double south, double east, double north); static BoundingBox fromNominatim(JSONArray json); static BoundingBox fromPositionAndRadius(IPosition position, double distanceInMeters); static double getLongitude(double longitude); static double getLatitude(double latitude); String asSqlQueryString(String columnLongitude, String columnLatitude); List<PlantsCache.Marker> selectPositionsInsideAfterSQLQuery(List<PlantsCache.Marker> positions); static double distanceInMetersBetween(IPosition p1, IPosition p2); static BoundingBox fromNESW(double north, double east, double south, double west); boolean contains(Position position); Position middle(); static BoundingBox ofTileAt(TilePosition position); double southBorderLatitude(); double northBorderLatitude(); Position southWestCorner(); Position southEastCorner(); Position northWestCorner(); Position northEastCorner(); @Override boolean equals(Object obj); @Override int hashCode(); JSONObject toJSON(); static BoundingBox fromJSON(JSONObject json); double deltaLongitude(); boolean crosses180(); String toExtentString();  }
@Test public void getLongitude() { double delta = 1e-2; double longitude1 = 20.45; double longitude2 = -250.00; assertEquals(20.45, BoundingBox.getLongitude(longitude1), delta); assertEquals(110.00, BoundingBox.getLongitude(longitude2), delta); }