title: Android: Add separate resources for tests only
body: <p>I am developing an android library.</p>
  <p>The library takes in some parameters. For instance, it has a setStyle method which takes in a reference to a style resource:</p>
  <pre class="lang-kotlin prettyprint-override"><code>fun setStyle(@StyleRes style: Int) ...
  </code></pre>
  <p>I want to test this method. To do this, I want to pass a resource <code>TestStyle</code> to the library in a unit test. Something like this:</p>
  <pre class="lang-kotlin prettyprint-override"><code>myLibrary.setStyle(R.style.TestStyle)
  </code></pre>
  <p>However, I don't want to create the <code>TestStyle</code> resource in the main <code>src/main/res/values/styles.xml</code> because this would make the resource available to people using my library. I want it to only be available in tests.</p>
  <p>Instead, I tried to place the <code>TestStyle</code> <code>&lt;item /&gt;</code> in a new test-only file  at <code>src/test/res/values/styles.xml</code>. However, I can't figure out how to access this in the unit test, as it is not available through R.</p>
  <p>How can I create resources that are only accessible in tests and not in other parts of the code?</p>