code: public static <T> T median(final T a, final T b, final T c, Comparator<? super T> cmp) {
          cmp = cmp == null ? NATURAL_ORDER : cmp;
  
          int ab = cmp.compare(a, b);
          int ac = cmp.compare(a, c);
          int bc = 0;
  
          if ((ab >= 0 && ac <= 0) || (ac >= 0 && ab <= 0)) {
              return a;
          } else if ((((bc = cmp.compare(b, c)) <= 0) && ab <= 0) || (bc >= 0 && ab >= 0)) {
              return b;
          } else {
              return c;
          }
      }
docs: Gets the median of three values.
  
  @param a
  @param b
  @param c
  @return the median of the values
  @see #median(int...)