JUnit simply can’t yet (at time of writting, 2022).
But both JExample and TestNG have something like that.
- Said libraries provide their own test runner, which supports their dependency mechanism.
- And both can be used alongside JUnit (without need to rewrite existing classes).
- But TestNG seems more promising.
I don’t know how useful it is, but if you try it, please come back to tell us whether it was useful.