It might be that I don't understand your problem and if so I apologize, but from what I gather this is a classic XY problem.
Use property-based tests instead. Like quickcheck/jqwik/hypothesis.
Use property-based tests instead. Like quickcheck/jqwik/hypothesis.
Why is this different than what you are asking?
https://jqwik.net/docs/current/user-guide.html#customized-pa...
Yes, of course you do have to define some patterns, but you can do that for arbitrary types and the internal randomizer takes care of the rest. You could have multiple cases, say: one that's fully random, one where you have some integers, one where you have strings, etc.