title: How to throw exception for a local object method call?
body: <p>MyCode:</p>
  <pre><code>class LocalClass{
    public getNumber(){
      retunr 5;
    }
  }
  
  class AnotherLocalClass{
    public static getNumber(){
      retunr 10;
    }
  }
  
  public class A{
  
    public int methodAa(Boolean flag, int paramValue){
     return methodA(flag, paramValue);
    }
  
    private int methodA(Boolean flag, int paramValue){
    int returnValue = 0;
      try{
        if(flag){
          LocalClass localVariable = new LocalClass();
          returnValue = localVariable.getNumber() + paramValue;
        } else{
          returnValue = AnotherLocalClass.getNumber() + paramValue;
        }
       return returnValue;
      }catch(Exception e){
         e.printStackTrace();
         return 0;
      }
    }
  }
  
  public class ATest{
    @InjectMocks
    A a;
    
    public void methodATest(){
     //need help to write here
    }
  }
  </code></pre>
  <p><code>LocalClass</code> and <code>AnotherLocalClass</code> are classes that contains a method that returns a value.</p>
  <p><code>getNumber</code> in <code>AnotherLocalClass</code> is a static method.</p>
  <p>Class <code>A</code> is the main class for which I am writing <code>ATest</code> class.</p>
  <p>I can only write code in <code>methodATest</code>. And cannot change anything in <code>LocalClass</code>, <code>AnotherLocalClass</code> or class <code>A</code>.</p>
  <p>I want to write <code>methodATest</code> such that <code>methodA</code> throws an exception.</p>
  <p>My mockito version is 1.19.10 and it cannot be changed.</p>
  <p>And also I cannot use PowerMockito or any other new dependency.</p>