title: android - gradle task called mockableAndroidJar how to actually use it in unitTests
body: <p>When i ran ./gradlew tasks i notice a build task called mockableAndroidJar.  The description says the following : </p>
  
  <blockquote>
    <p>Creates a version of android.jar that's suitable for unit tests.</p>
  </blockquote>
  
  <p>Can someone give me an example how i can use this jar mock in code ? </p>
  
  <p>From the <a href="http://tools.android.com/tech-docs/unit-testing-support" rel="nofollow noreferrer">android tools page</a> i saw the following:</p>
  
  <blockquote>
    <p>Unit tests run on a local JVM on your development machine. Our gradle plugin will compile source code found in src/test/java and execute it using the usual Gradle testing mechanisms. At runtime, tests will be executed against a modified version of android.jar where all final modifiers have been stripped off. This lets you use popular mocking libraries, like Mockito.</p>
  </blockquote>
  
  <p>But my question is can someone show me how i can make my test use this new android.jar file  instead of the current one that has finals on the classes ? How to point tests to use this jar instead ? I saw <a href="https://stackoverflow.com/questions/34853185/how-to-use-mockableandroidjar">this question</a> but its not showing me how to use this in tests, only gives theory.  I actually ran the following command from shell:</p>
  
  <pre><code>./gradlew mockableAndroidJar
  </code></pre>
  
  <p>and the output was the following:</p>
  
  <pre><code>    $./gradlew mockableAndroidJar
  Picked up JAVA_TOOL_OPTIONS: -Xmx512m -Xms64m
  Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=768m; support was removed in 8.0
  Incremental java compilation is an incubating feature.
  :app:mockableAndroidJar UP-TO-DATE
  
  BUILD SUCCESSFUL
  
  Total time: 1.226 secs
  </code></pre>
  
  <p>So i thought there would be some change in my directory structure but i dont see any.  Is the jar file automatically swapped for me ?</p>