title: How can we mock a response from another class using Mockito while unit testing
body: <p>I have a method to test which is calling another class to get some information:</p>
  
  <pre><code>public ClassToTest {
  
      public void methodToTest() {
          AnotherClass ac = Factory.getInstance();
          ResponseObj response = ac.anotherMethod();
      }
  }
  </code></pre>
  
  <p>AnotherClass is part of another JAR and I would like to mock the response from it(to be specific mock ResponseObj response)</p>
  
  <p>How can I achieve that using Mockito?</p>