code: public BoundingBox overlap(BoundingBox boundingBox, boolean allowEmpty) {
  
  		double minLongitude = Math.max(getMinLongitude(),
  				boundingBox.getMinLongitude());
  		double maxLongitude = Math.min(getMaxLongitude(),
  				boundingBox.getMaxLongitude());
  		double minLatitude = Math.max(getMinLatitude(),
  				boundingBox.getMinLatitude());
  		double maxLatitude = Math.min(getMaxLatitude(),
  				boundingBox.getMaxLatitude());
  
  		BoundingBox overlap = null;
  
  		if ((minLongitude < maxLongitude && minLatitude < maxLatitude)
  				|| (allowEmpty && minLongitude <= maxLongitude && minLatitude <= maxLatitude)) {
  			overlap = new BoundingBox(minLongitude, minLatitude, maxLongitude,
  					maxLatitude);
  		}
  
  		return overlap;
  	}
docs: Get the overlapping bounding box with the provided bounding box
  
  @param boundingBox
  bounding box
  @param allowEmpty
  allow empty ranges when determining overlap
  
  @return bounding box
  @since 3.1.0