code: private double distance() {
          // if items, compute exact distance
          if (isLeaves()) {
              return itemDistance.distance((ItemBoundable) boundable1, (ItemBoundable) boundable2);
          }
          // otherwise compute distance between bounds of boundables
          return ((Envelope) boundable1.getBounds()).distance(((Envelope) boundable2.getBounds()));
      }
docs: Computes the distance between the {@link org.locationtech.jts.index.strtree.Boundable}s in this pair.
  The boundables are either composites or leaves.
  If either is composite, the distance is computed as the minimum distance
  between the bounds.
  If both are leaves, the distance is computed by {@link #itemDistance(org.locationtech.jts.index.strtree.ItemBoundable, org.locationtech.jts.index.strtree.ItemBoundable)}.
  
  @return