android/guava/src/com/google/common/collect/Ordering.java
@GwtCompatible(serializable = true)
  public static <T> Ordering<T> from(Comparator<T> comparator) {
    return (comparator instanceof Ordering)
        ? (Ordering<T>) comparator
        : new ComparatorOrdering<T>(comparator);
  }
@GwtCompatible(serializable = true)
  public static <T> Ordering<T> from(Comparator<T> comparator) {
    return (comparator instanceof Ordering)
        ? (Ordering<T>) comparator
        : new ComparatorOrdering<T>(comparator);
  }
Returns an ordering based on an <i>existing</i> comparator instance. Note that it is
unnecessary to create a <i>new</i> anonymous inner class implementing {@code Comparator} just
to pass it in here. Instead, simply subclass {@code Ordering} and implement its {@code compare}
method directly.

<p><b>Java 8 users:</b> this class is now obsolete as explained in the class documentation, so
there is no need to use this method.

@param comparator the comparator that defines the order
@return comparator itself if it is already an {@code Ordering}; otherwise an ordering that
wraps that comparator