title: Can't mock final class in test using Mockito with Kotlin
body: <p>I'm trying to run a simple instrumentation test:</p>
  
  <pre><code>class DefaultTest {
  
      private val networkHelper = Mockito.mock(NetworkHelperImpl::class.java)
  
      @Test fun inter() {
          given(networkHelper.isConnectedToNetwork()).willReturn(true)
          assertFalse { networkHelper.isConnectedToNetwork(false) }
      }
  }
  </code></pre>
  
  <p>But i cant bacause of error:</p>
  
  <pre><code>Mockito cannot mock/spy because :
  - final class
  </code></pre>
  
  <p>How can i avoid it?</p>
  
  <p>As this guide says:</p>
  
  <p><a href="https://antonioleiva.com/mockito-2-kotlin/" rel="noreferrer">https://antonioleiva.com/mockito-2-kotlin/</a></p>
  
  <p>I'm create file:</p>
  
  <p><a href="https://i.stack.imgur.com/pcwJw.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pcwJw.png" alt="enter image description here"></a></p>
  
  <p>With this line:</p>
  
  <p><code>mock-maker-inline</code></p>
  
  <p>But nothing changes.</p>
  
  <p>Gradle is bad(i'm learning), but it must work. I use unit test too, so now i have:</p>
  
  <pre><code>//Tests
  testImplementation 'junit:junit:4.13-beta-3'
  
  testImplementation 'org.jetbrains.kotlin:kotlin-stdlib:1.3.41'
  testImplementation 'org.jetbrains.kotlin:kotlin-test-junit:1.3.41'
  
  androidTestImplementation 'org.mockito:mockito-core:3.0.0'
  androidTestImplementation 'org.mockito:mockito-android:2.24.5'
  androidTestImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0"
  
  testImplementation 'org.amshove.kluent:kluent:1.14'
  
  androidTestImplementation 'androidx.test:runner:1.2.0'
  androidTestImplementation 'androidx.test:core:1.2.0'
  androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  androidTestImplementation 'androidx.test:rules:1.2.0'
  </code></pre>