public static <T1, T2 extends Comparable<T2>> Comparator<T1> getNullSafeComparator(
            final Function<T1, T2> extractor) {

        // Sort with nulls first but also handle null intermediate values
        return Comparator.nullsFirst(Comparator.comparing(
                extractor,
                Comparator.nullsFirst(Comparator.naturalOrder())));
    }
Creates a null safe case-insensitive comparator that can work with stuff like
getDocRef().getName()
stroom-util-shared/src/main/java/stroom/util/shared/CompareUtil.java