docs: public static int median(final Object[] a, int start, int end, Comparator<Object> cmp)
      {
          final int m = start + ((end - start) / 2);
          int smallest = start;
  
          if (cmp.compare(a[smallest], a[m]) > 0) {
              smallest = m;
          }
          if (cmp.compare(a[smallest], a[end]) > 0) {
              smallest = end;
          }
  
          if (smallest == start) {
              return (cmp.compare(a[m], a[end]) < 0) ? m : end;
          }
          if (smallest == m) {
              return (cmp.compare(a[start], a[end]) < 0) ? start : end;
          }
          return (cmp.compare(a[start], a[m]) < 0) ? start : m;
      }