Having a separate counting method runs the risk of a mismatch between
the actual reduction method and the counting method.
Instead, create an Oracle that always returns true for shouldKeep(), run
the reduction, and count how many times shouldKeep() was called. The
module should not be modified if shouldKeep() always returns true.
Did you consider adding a test/assertion for the number of calls to shouldKeep() by the reduce function remains the same every time? Having an explicit count function requires one to think how many there are, but I fear it will also be easier to write reduce functions whose number of targets depends on the result of the shouldKeep() function.