title: How to mock an object with Guice @Inject?
body: <p>I have a class A and a class B.</p>
  <pre><code>public class A{
      @Inject // Guice Inject
      private B b;
  }
  </code></pre>
  <p>The test class looks like -</p>
  <pre><code>public class ATest{
      private B b;
      
      private A a;
  
      @Before
      public void setup() {
          b = Mockito.mock(b.class);
          a = new A();
      }
  }
  </code></pre>
  <p>The thing is that class B isn't getting mocked. In the test class, there's a NullPointerException whenever a method of B is getting invoked. I can't make changes to class A. Please help me out on how to mock class B successfully?</p>