docs: public static double overlap(SpatialComparable box1, SpatialComparable box2) {
      final int dim = assertSameDimensionality(box1, box2);
  
      // the maximal and minimal value of the overlap box.
      double omax, omin;
  
      // the overlap volume
      double overlap = 1.;
  
      for(int i = 0; i < dim; i++) {
        // The maximal value of that overlap box in the current
        // dimension is the minimum of the max values.
        omax = Math.min(box1.getMax(i), box2.getMax(i));
        // The minimal value is the maximum of the min values.
        omin = Math.max(box1.getMin(i), box2.getMin(i));
  
        // if omax <= omin in any dimension, the overlap box has a volume of zero
        if(omax <= omin) {
          return 0.;
        }
  
        overlap *= omax - omin;
      }
  
      return overlap;
    }