public static <T1, T2> BiPredicate<T1, T2> countingBiPredicate(final LongAdder counter,
                                                                   final BiPredicate<T1, T2> predicate) {
        Objects.requireNonNull(predicate);
        Objects.requireNonNull(counter);
        return (t1, t2) -> {
            final boolean result = predicate.test(t1, t2);
            if (result) {
                counter.increment();
            }
            return result;
        };
    }
Creates a {@link BiPredicate} that increments counter for each match encountered.

@param counter   The counter to increment. It is the caller's responsibility to zero it as needed.
@param predicate The {@link BiPredicate} to wrap
@return The wrapped predicate
stroom-util/src/main/java/stroom/util/PredicateUtil.java