title: How to mock a method of the same class?
body: <p>In the testing method, there are methods of the same class. How to mock the methods of the same class?</p>
  
  <p>An example is as follows. </p>
  
  <p>I am testing method2. It involves method1 which is in the same class. How to mock this method1?</p>
  
  <pre><code>public class A
  {
    public void method1(int a, int b){
  
    }
  
    public void method2(){
  
        int value = method1(10,20);
    }
  }
  </code></pre>