title: How to read resource file from unit test?
body: <p>I have a Java-only module in my Android project. In that project I want to have a unit test that reads the contents from a local json file that is stored in the resources folder. Android Studio changes the icon of the resources folder, so I'd think it recognises it as the resources folder.</p>
  
  <p>How I'm reading:</p>
  
  <pre><code>String json = Files.lines(Paths.get("file.json"))
                  .parallel()
                  .collect(Collectors.joining());
  </code></pre>
  
  <p>folder structure:</p>
  
  <pre><code>+project
    +app (android)
    +module (java only)
      +src
        +main
          +java
            +package
              -the java file
          +resources
              -file.json
  </code></pre>
  
  <p>My question is how can I read the file?</p>
  
  <p><strong>updated below</strong></p>
  
  <pre><code>URL resource1 = getClass().getResource("file.json");
  URL resource2 = getClass().getClassLoader().getResource("file.json");
  URL resource3 = Thread.currentThread().getContextClassLoader().getResource("file.json");
  URL resource4 = ClassLoader.getSystemClassLoader().getResource("file.json");
  </code></pre>
  
  <p>All these are null. 
  I've copied the json file to <code>resources/same.package.structure</code> too, but to no success.</p>