code: public static <T extends Comparable<? super T>> Integer getSortOrder(final T first, final T second) {
          if (first == null && second == null) return null;
  
          if (first == null && second != null) return -1;
  
          if (first != null && second == null) return 1;
  
          return first.compareTo(second);
      }
docs: Provides an easy way to compare two possibly null comparable objects
  
  @param first  The first object to compare
  @param second The second object to compare
  @return < 0 if the first object is less than the second object, 0 if they are equal, and > 0 otherwise