code: public static <T> int compare(final T a, final T b, final Comparator<? super T> cmp) {
          return a == null ? (b == null ? 0 : -1) : (b == null ? 1 : (cmp == null ? NATURAL_ORDER : cmp).compare(a, b));
      }
docs: Returns 0 if the arguments are identical and {@code c.compare(a, b)}
  otherwise. Consequently, if both arguments are {@code null} 0 is
  returned.
  
  <p>
  Note that if one of the arguments is {@code null}, a
  {@code NullPointerException} may or may not be thrown depending on what
  ordering policy, if any, the {@link Comparator Comparator} chooses to
  have for {@code null} values.
  
  @param <T>
  the type of the objects being compared
  @param a
  an object
  @param b
  an object to be compared with {@code a}
  @param cmp
  the {@code Comparator} to compare the first two arguments
  @return 0 if the arguments are identical and {@code c.compare(a, b)}
  otherwise.
  @see Comparable
  @see Comparator