code: public static <T> Comparator<T> nullSafeArgumentsComparator(Comparator<T> delegate) {
      return (T obj1, T obj2) -> (obj1 == null ? 1 : (obj2 == null ? -1 : delegate.compare(obj1, obj2)));
    }
docs: Wraps an exiting {@link Comparator} in a null-safe, delegating {@link Comparator} implementation to protect
  against {@literal null} arguments passed to the {@literal compare} method.
  Sorts (order) {@literal null} values last.
  
  @param <T> Class type of the objects to compare.
  @param delegate {@link Comparator} delegate.
  @return a null-safe, delegating {@link Comparator} implementation wrapping the given {@link Comparator}.
  @see java.util.Comparator