mockito testing verify with 0 calls
<pre><code>    Class MyClass{
    method3(){
      if(condition){
        method1()
      }

      else{

      method2()

      }

    }

     method1(){
     //do woo
      }

     method3(){
        //do foo
      }
 }
</code></pre>

<p>I am trying to test <code>method3</code> only if case  is called so else method is not called.</p>

<pre><code>   MyClass myClassMock=   mock(MyClass.class);
         myClassMock.method3();
         verify( myClassMock, times(0)).method2();
</code></pre>

<p>But then this calls my <code>method2</code>  and throws null pointer inside <code>method2</code>. How can I test this  without calling <code>method2</code> because my behavior wont call <code>method2</code>.</p>