public static <T> Predicate<T> toNullSafePredicate(final boolean resultIfNull,
                                                       final Predicate<T> predicate) {
        return obj -> {
            if (obj == null) {
                return resultIfNull;
            } else {
                return predicate.test(obj);
            }
        };
    }
Wraps the passed {@link Predicate} with one that returns result
if the value under test is null
stroom-query/stroom-query-common/src/main/java/stroom/query/common/v2/StringPredicateFactory.java