title: What is the proper way to declare @BeforeClass on a test in Android with Kotlin
body: <p>I have an InstrumentedTest class like this:</p>
  <pre><code>@RunWith(AndroidJUnit4::class)
  class MyInstrumentedTest {
      @Inject
      private lateinit var myVar:MyType
  
      @BeforeClass
      fun method(){
          with(myVar){
          ...
  </code></pre>
  <p>This gives an error because <code>method</code> must be static. If I put the @BeforeClass method inside a companion object and annotate with @JvmStatic, the injected myVar can't be used. Is there a more proper way to use the @BeforeClass using kotlin, in gereral and in this situation?</p>