title: How to mock local variable obtained from another method of tested class?
body: <p>I have following class</p>
  
  <pre><code>class MyClass{
     public void m(InputStream is){
         ...
         Parser eParser = getExcelFileParser();
         eParser.parse(is);
         ...
         eParser.foo();
         eParser.bar();
  
     }
     public ExcelFileParser getExcelFileParser(){
         ...
     } 
  }
  </code></pre>
  
  <p>How to write unit test for method <code>m</code> at this situation? I want to mock  <code>eParser</code> object only.</p>
  
  <p>Is it possible?</p>
  
  <p>I use Mockito and PowerMockito</p>