title: How to tell a Mockito Mock annotation to return a mock object which is not null?
body: <p>I am trying to unit test a method, which has different branches depending upon the value of an object that is created inside it. The below code demonstrates it.</p>
  
  <pre><code>public class AClass {
  
  public void method2() {
    //Some code goes here
  }
  public void method1(BClass bObject) {
      C_Class cObject = bObject.someMethodThatReturnsC();
      if(cObject != null) {
          method2();
          method2();
      }
  }}
  </code></pre>
  
  <p>Below is the TestClass:</p>
  
  <pre><code>public class AClassTest {
  @InjectMocks
  AClass AClassSpy;
  
  @Mock
  BClass b_objectMock;
  
  @Mock
  C_Class c_objectMock;
  
  @BeforeMethod
  public void beforeMethod() {
    AClassSpy = spy(new AClass());      
    MockitoAnnotations.initMocks(this);
  }
  
  public void method1Test () {
      doReturn(c_objectMock).when(b_objectMock).someMethodThatReturnsC());
      AClassSpy.method1(b_objectMock);
      verify(AClassSpy, times(2).method2();
  }
  }
  </code></pre>
  
  <p>However, it always FAILS, since the c_objectMock is always null. What do I do to tell Mockito to not to return a null object? </p>