title: How to mock an if condition for the below code?
body: <p>This is my code:</p>
  
  <pre><code>if(a.getObj().getReq()== 5)
    { class.dosomething1(a)}
  else
     { class.something2(a);}
  </code></pre>
  
  <p>My Junit class is </p>
  
  <pre><code>@InjectMocks
  Class1 class;
  @Mocks
  A a;
  @Mocks
  B b;
  
  Mockito.when(a.getObj()).thenReturn(b);
  Mockito.when(b.getType()).thenReturn(11);
  class.method(a);
  </code></pre>
  
  <p>Here I need to go to the else condition but mocking isn't happening since when the function is called actual parameter is passed insted if what mockito returns. Please help me on this. I have to make that if condition false somehow and please note that A and B are API classes I mean these are not defined by me.</p>