title: Any way to mock File.exist()/ File.isFile() method with Mockito?
body: <pre><code>ArrayList&lt;File&gt; m_files = new ArrayList&lt;File&gt;();
  for(int i = 0; i &lt; m_files.size(); i++) {
       File m_file = m_files.get(i);
       if(m_file.exists()) {
          FileUtils.deleteQuietly(m_file);
          if(m_file.isFile()) {
            m_log.error("Deleting file " + m_file.getName() +" fails");
            throw new ServiceUnavailableException("Not successfully delete the file " + m_file.getName());
          } else {
            m_log.info("Successfully delete the file " + m_file.getName());
          }
       }
    }
  </code></pre>
  
  <p>My code is about deleting some local files. I want to do a unit test for the situation when Deleting the file fails. Is there any way to mock file.exist()/file.isFile() or anyway to mock that static method FileUtiles.deleteQuitely() or other solutions?</p>