title: Mockito: mocking final class in UI tests
body: <p>So starting with Android <strong>P</strong>, it is possible to mock final classes for UI / Espresso tests. Great.</p>
  <p>After some research, I was using <code>com.linkedin.dexmaker:dexmaker-mockito-inline-extended</code> to be able to mock final classes.</p>
  <p>However, it uses and old version of mockito (<code>2.28.0</code> at the time of writing this post) while Mockito has recently released version <code>3.15.13</code>.</p>
  <p>Up until now I was fine using an <em>old</em> version of Mockito until I stumbled on issues solved in later version.</p>
  <p>The following gradle configuration:</p>
  <pre><code>androidTestImplementation &quot;com.linkedin.dexmaker:dexmaker-mockito-inline-extended:2.28.0&quot;
  androidTestImplementation &quot;com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0&quot;
  androidTestImplementation &quot;org.mockito:mockito-android:3.5.13&quot;
  </code></pre>
  <p>produces this error at compile time:</p>
  <blockquote>
  <p>More than one file was found with OS independent path 'mockito-extensions/org.mockito.plugins.MockMaker'.</p>
  </blockquote>
  <p>I believe I know it means that some dependencies use the same dependency. I tried using exclude but without success.</p>
  <p>Has anyone an idea on how to fix that ? Thanks for the help !</p>