docs: protected static int pivotizeList1D(List<? extends SpatialComparable> objs, int start, int end, int dim, double threshold, boolean desc) {
      @SuppressWarnings("unchecked") // Hack, for swapping elements.
      final List<SpatialComparable> sobjs = (List<SpatialComparable>) objs;
      threshold = 2 * threshold; // because we use minPlusMax coordinates below
      int s = start, e = end - 1;
      while(s <= e) {
        if(!desc) {
          double sminmax = getMinPlusMaxObject(objs, s, dim);
          while(sminmax < threshold && s <= e) {
            sminmax = ++s <= e ? getMinPlusMaxObject(objs, s, dim) : Double.POSITIVE_INFINITY;
          }
          double eminmax = getMinPlusMaxObject(objs, e, dim);
          while(eminmax >= threshold && s <= e) {
            eminmax = --e >= s ? getMinPlusMaxObject(objs, e, dim) : Double.NEGATIVE_INFINITY;
          }
        }
        else {
          double sminmax = getMinPlusMaxObject(objs, s, dim);
          while(sminmax > threshold && s <= e) {
            sminmax = ++s <= e ? getMinPlusMaxObject(objs, s, dim) : Double.POSITIVE_INFINITY;
          }
          double eminmax = getMinPlusMaxObject(objs, e, dim);
          while(eminmax <= threshold && s <= e) {
            eminmax = --e >= s ? getMinPlusMaxObject(objs, e, dim) : Double.NEGATIVE_INFINITY;
          }
        }
        if(s >= e) {
          break;
        }
        // Swap
        sobjs.set(s, sobjs.set(e, sobjs.get(s)));
        ++s;
        --e;
      }
      return s;
    }