class CollectionFunctions {

    public static <T> BinaryOperator<T> nullSafe(final BinaryOperator<T> notNullSafe) {
        return (t1, t2) -> {
            if (t1 != null && t2 != null) {
                return notNullSafe.apply(t1, t2);
            } else if (t1 != null) {
                return t1;
            } else return t2;
        };
    }

    private  CollectionFunctions();

}