title: How to avoid inheritance in JUnit test cases?
body: <p>I have a number of test cases in JUnit. All of them need the same code to be executed in their <code>@BeforeClass</code> static method. It's a code duplication and I'm trying to get rid of it. A dirty way of doing this is by inheritance. Are there any other mechanisms in JUnit, that may help?</p>
  
  <p>PS. I wrote this blog post about this very subject: <a href="http://www.yegor256.com/2015/05/25/unit-test-scaffolding.html" rel="noreferrer">http://www.yegor256.com/2015/05/25/unit-test-scaffolding.html</a></p>