title: Mock a private method
body: <p>I have a method which is private . Now, I do not want to call this private method while doing unit test on <code>execute()</code> method. I have tried with PowerMockito and all, but with all type of mockings it still enter into the private method. </p>
  
  <p>Please suggest with workable testcase. Would appreciate the same.</p>
  
  <pre><code>@Component 
  public class Employee implements SuperClass {
  
      @Autowired
      private FileTraverse fileTraverse;
  
      @Override 
      public void execute() throws Exception {
          List&lt;String&gt; traverse = fileTraverse.getFiles();
          Boolean t = isFileTraversed(traverse);
      } 
  
      private Boolean isFileTraversed(List&lt;String&gt; param1) {
          Boolean flag;
          //do some DB operation and return flag;
      }
  }
  </code></pre>