According to this answer, the @Before annotation is executed once before each test, whereas the @BeforeClass annotation is only executed once before all tests.
My intuition tells me to always use @BeforeClass, so the question is, why even use @Before? Is there a case where the @Before annotation performs better/faster than the @BeforeClass annotation?
@Beforepaired withassumeFalseto exclude certain tests. So it's not really a performance issue I guess, it's more of, if I don't need to re-check redundant conditions, I should be using@BeforeClass.@Before public void exclude() { assumeFalse(condition); }