title: Testing Private method using mockito
body: <pre class="lang-java prettyprint-override"><code>public class A {
  
      public void method(boolean b){
            if (b == true)
                 method1();
            else
                 method2();
      }
  
      private void method1() {}
      private void method2() {}
  }
  
  public class TestA {
  
      @Test
      public void testMethod() {
        A a = mock(A.class);
        a.method(true);
        //how to test like    verify(a).method1();
      }
  }
  </code></pre>
  <p>How to test private method is called or not, and how to test private method using mockito?</p>