public static <T> Comparator<T> reverseIf(final Comparator<T> comparator, final boolean isReversed) {
        if (comparator == null) {
            return null;
        } else {
            return isReversed
                    ? comparator.reversed()
                    : comparator;
        }
    }
Reverse the comparator if isReversed is true, else just return comparator unchanged.
Null-safe.
stroom-util-shared/src/main/java/stroom/util/shared/CompareUtil.java