code: public static <E extends Comparable<E>> Interval<E> toValidInterval(E a, E b) {
      return toValidInterval(a,b,0);
    }
docs: Create an interval with the specified endpoints, reordering them as needed
  @param a one of the endpoints
  @param b the other endpoint
  @param <E> type of the interval endpoints
  @return Interval with endpoints re-ordered as needed