public static <T extends Comparable<? super T>> int compare(T c1, T c2, boolean nullGreater) {
        if (c1 == c2) {
            return 0;
        } else if (c1 == null) {
            return nullGreater ? 1 : -1;
        } else if (c2 == null) {
            return nullGreater ? -1 : 1;
        }
        return c1.compareTo(c2);
    }
<p>Null safe comparison of Comparables.</p>

@param <T> type of the values processed by this method
@param c1  the first comparable, may be null
@param c2  the second comparable, may be null
@param nullGreater if true {@code null} is considered greater
 than a non-{@code null} value or if false {@code null} is
 considered less than a Non-{@code null} value
@return a negative value if c1 < c2, zero if c1 = c2
 and a positive value if c1 > c2
@see Comparator#compare(Object, Object)
android/android_framework/base/src/main/java/lang3/ObjectUtils.java