title: Mockito Spy Test
body: <p>I am using Mockito to write tests for code. However I am stuck at following scenario - 
  Class A has 2 methods, method1() and method2(). I tried using ArgumentCaptor to catch values sent to method2(). But, since I am using @Spy, I cannot use Matchers.</p>
  
  <p>How do I test method1()?</p>
  
  <pre><code>class A{
      B b;
      method1(arg1, arg2){
         //some logic
         method2(arg1, arg2, ....argN);
      }
  
     method2(arg1, arg2,....argN){
         //some logic
         b.method3(arg1, arg2...);
     }
  }
  </code></pre>
  
  <p>How to verify method2 receives same argument values?
  Following is the test class I wrote: </p>
  
  <pre><code>Class TestA{
  
  @Mock
  B b;
  
  @Spy
  @InjectMocks   //required else b is null
  A a = new A();
  
  @Test
  public void testMethod1(){
  
   a.method1(arg1, arg2);
  
    //How to verify method2 receives same argument values (arg1, arg2)????
    //verify(a, times(1)).method2(.......);   
  }
  </code></pre>
  
  <p>}</p>