title: Mock method called inside testing method in same class
body: <pre><code> public class MyClass {
  
     public int result(){
       int result = calculate(new ValueProvider());
            return result;
        }
  
     public int calculate(ValueProvider provider){
              return provider.getSalary();
        }
  
  }
  
  public class ValueProvider {
  
      public int getSalary(){
          return 10000000;
      }
  }
  </code></pre>
  
  <p>I need to test method <code>result()</code>, but have to mock second method calculate which should return default value.</p>