CoordinateBounds implements Serializable { public void addPoint(double lat, double lon) { if (_empty) { _empty = false; _minLat = lat; _minLon = lon; _maxLat = lat; _maxLon = lon; } else { _minLat = Math.min(_minLat, lat); _minLon = Math.min(_minLon, lon); _maxLat = Math.max(_maxLat, lat); _maxLon = Math.max(_maxLon, lon); } } CoordinateBounds();  CoordinateBounds(double lat, double lon);  CoordinateBounds(CoordinateBounds bounds);  CoordinateBounds(double minLat, double minLon, double maxLat,
      double maxLon); boolean isEmpty(); void setEmpty(boolean empty); double getMinLat(); void setMinLat(double minLat); double getMinLon(); void setMinLon(double minLon); double getMaxLat(); void setMaxLat(double maxLat); double getMaxLon(); void setMaxLon(double maxLon); void addPoint(double lat, double lon); void addBounds(CoordinateBounds bounds); void clear(); boolean contains(double lat, double lon); boolean contains(CoordinatePoint point); boolean intersects(CoordinateBounds r); CoordinateBounds intersection(CoordinateBounds r); CoordinateBounds union(CoordinateBounds r); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testAddPoint() { CoordinateBounds bounds = new CoordinateBounds(); bounds.addPoint(1,2); assertEquals(1, bounds.getMinLat(), 0); assertEquals(2, bounds.getMinLon(), 0); assertEquals(1, bounds.getMaxLat(), 0); assertEquals(2, bounds.getMaxLon(), 0); bounds.addPoint(0,5); assertEquals(0, bounds.getMinLat(), 0); assertEquals(2, bounds.getMinLon(), 0); assertEquals(1, bounds.getMaxLat(), 0); assertEquals(5, bounds.getMaxLon(), 0); }