What is proper workaround for @BeforeAll in Kotlin
<p>Currently the JUnit 5 API only allows <code>@BeforeAll</code> on a method that is static.</p>
<p>So if I do something like this, it will not compile:</p>
<pre><code>@BeforeAll
  fun setup() {
    MockitoAnnotations.initMocks(this)
    mvc = MockMvcBuilders.standaloneSetup(controller).build()
}
</code></pre>
<p>In order to have a static method in Kotlin, I have to use <code>companion object</code> like this:</p>
<pre><code>companion object {
    @JvmStatic
    @BeforeAll
    fun setup() {
      MockitoAnnotations.initMocks(this)
      mvc = MockMvcBuilders.standaloneSetup(smsController).build()
    }
}
</code></pre>
<p>This will compile, but I don't have access to variables from the parent class. So what would be the idiomatic way to invoke JUnit 5 <code>@BeforeAll</code> with Kotlin?</p>