title: How to use mockk in view binding
body: <p>Hi i am new in Mockk library Kotlin. I want to mock view binding in unit testing. But i am unable to get proper example. I search <a href="https://stackoverflow.com/questions/60965983/possible-to-mock-test-android-viewbinding-interactions">Possible to mock/test Android ViewBinding interactions?
  </a> I don't want to use <strong>@RunWith(PowerMockRunner::class)</strong>. Does any one have better solution for this.</p>
  <p>After @Eddie reply i tried my basic code.</p>
  <pre><code>class MainActivity : AppCompatActivity() {
  
      private lateinit var binding: ActivityMainBinding
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          binding = ActivityMainBinding.inflate(layoutInflater)
          setContentView(binding.root)
  
          setText()
      }
  
      internal fun setText() {
          binding.test.text = &quot;shh&quot;
      }
  }
  </code></pre>
  <p>Test class</p>
  <pre><code>class MainActivityTest {
  
      @get:Rule
      val testInstantTaskExecutorRule: TestRule = InstantTaskExecutorRule()
  
      private lateinit var mainActivity: MainActivity
  
      @MockK
      private lateinit var mainBinding: ActivityMainBinding
  
      @Before
      fun setUp() {
          MockKAnnotations.init(this, relaxed = true)
          mockkStatic(ActivityMainBinding::class)
          mainActivity = spyk(MainActivity())
      }
  
      @Test
      fun `setupText - set text`() {
          verify { mainBinding.test.text = &quot;2&quot; }
          mainActivity.setText()
      }
  }
  </code></pre>
  <p>I am getting this error</p>
  <pre><code>java.lang.NullPointerException
      at com.example.test.MainActivityTest$setupText - set text$1.invoke(MainActivityTest.kt:34)
      at com.example.test.MainActivityTest$setupText - set text$1.invoke(MainActivityTest.kt:34)
      at io.mockk.impl.eval.RecordedBlockEvaluator$record$block$1.invoke(RecordedBlockEvaluator.kt:24)
      at io.mockk.impl.eval.RecordedBlockEvaluator$enhanceWithRethrow$1.invoke(RecordedBlockEvaluator.kt:74)
      at io.mockk.impl.recording.JvmAutoHinter.autoHint(JvmAutoHinter.kt:23)
      at io.mockk.impl.eval.RecordedBlockEvaluator.record(RecordedBlockEvaluator.kt:36)
      at io.mockk.impl.eval.VerifyBlockEvaluator.verify(VerifyBlockEvaluator.kt:30)
      at io.mockk.MockKDsl.internalVerify(API.kt:118)
      at io.mockk.MockKKt.verify(MockK.kt:149)
      at io.mockk.MockKKt.verify$default(MockK.kt:146)
      at com.example.test.MainActivityTest.setupText - set text(MainActivityTest.kt:34)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
      at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
      at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
      at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
      at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
      at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
      at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
      at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
      at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
  </code></pre>