title: how to mock method from same class using junit
body: <p>I am using JUnit and my situation is as follow: </p>
  
  <pre><code>class A{
      public int[] method1(){
         ...
         int res = method2();
         ...
         return intArray;
      }
  
      public int method2(){
        ....
        return intA;
      }
  }
  </code></pre>
  
  <p>I am trying following to mock the <code>method2()</code></p>
  
  <pre><code>new MockUp&lt;MockClass&gt;() {
              int[] methodToMock() {
                  int[] mockedResult = {1, 2, 4, 6};
                  return mockedResult;
              }
          };
  </code></pre>
  
  <p>Above code works fine when i use it for another class .
  But if i want to mock method from same class it doesn't works. </p>
  
  <p>please guide me to find the mocking method in JUnit, to mock method from same class.</p>
  
  <p>Thanks.</p>