Add maxDiscardedFactor factory method and tests.