title: How to mock a local instance of a method with mockito Junit
body: <p>I have the following method in the class CertainBean:</p>
  
  <pre><code>public boolean isOn() {
          InterfaceBean Bean = getBean();
          return Bean.hasBeenSetOn(Param1, Param2);
      }
  </code></pre>
  
  <p>Now I would like to </p>
  
  <pre><code>assertEquals(CertainBeanInstance.isOn(),true);
  </code></pre>
  
  <p>In order to do that I need first to mock IntefaceBean. How can I do that?</p>
  
  <p>Thanks in advance</p>