title: How to UnitTest static void functions in android (java)
body: <p>I have a class <code>FileCreator.class</code> and it has only static methods inside it. I want to test the function void <code>createTempFile(String path)</code>. And i understand that having void functions is bad practice because they only create side effects. But i need to test this functions side effect (if it created the file). I tried using </p>
  
  <pre><code>Mockito.doCallRealMethod().when(FileCreator.class).createTempFile(ArgumentMatchers.any(String.class)))
  </code></pre>
  
  <p>but it does not recognize createTempFile() as a function. I can easy fix this by making the method return boolean if it created the file but this will work only in this case and i was looking for a more general solution.</p>