### Question:
BBox implements Shape, Cloneable { public BBox calculateIntersection(BBox bBox) { if (!this.intersect(bBox)) return null; double minLon = Math.max(this.minLon, bBox.minLon); double maxLon = Math.min(this.maxLon, bBox.maxLon); double minLat = Math.max(this.minLat, bBox.minLat); double maxLat = Math.min(this.maxLat, bBox.maxLat); return new BBox(minLon, maxLon, minLat, maxLat); } @JsonCreator  BBox(double[] coords);  BBox(double minLon, double maxLon, double minLat, double maxLat);  BBox(double minLon, double maxLon, double minLat, double maxLat, double minEle, double maxEle);  BBox(double minLon, double maxLon, double minLat, double maxLat, double minEle, double maxEle, boolean elevation); static BBox createInverse(boolean elevation); boolean hasElevation(); void update(double lat, double lon); void update(double lat, double lon, double elev); BBox calculateIntersection(BBox bBox); @Override BBox clone(); @Override boolean intersect(Shape s); @Override boolean contains(Shape s); boolean intersect(Circle s); boolean intersect(BBox o); @Override boolean contains(double lat, double lon); boolean contains(BBox b); boolean contains(Circle c); @Override String toString(); String toLessPrecisionString(); @Override BBox getBounds(); @Override GHPoint getCenter(); @Override boolean equals(Object obj); @Override int hashCode(); boolean isValid(); List<Double> toGeoJson(); @Override double calculateArea(); static BBox parseTwoPoints(String objectAsString); static BBox parseBBoxString(String objectAsString); public double minLon; public double maxLon; public double minLat; public double maxLat; public double minEle; public double maxEle; }### Answer:
@Test public void testCalculateIntersection() { BBox b1 = new BBox(0, 2, 0, 1); BBox b2 = new BBox(-1, 1, -1, 2); BBox expected = new BBox(0, 1, 0, 1); assertEquals(expected, b1.calculateIntersection(b2)); b2 = new BBox(100, 200, 100, 200); assertNull(b1.calculateIntersection(b2)); b1 = new BBox(8.8591,9.9111,48.3145,48.8518); b2 = new BBox(5.8524,17.1483,46.3786,55.0653); assertEquals(b1, b1.calculateIntersection(b2)); }