title: Junit And Mockito, Capturing method call on passed argument
body: <p>I am relatively new to Mockito and Junit in Java. How can I capture or verify the interaction on the argument passed to function that I am testing.
  Ex-- Main class</p>
  <pre><code>public class A{
  
   public void setValues(Person p){
    p.setFirstName('Lucky');
    p.setLastName('Singh');
  
  // Some more code
   }
  }
  
  </code></pre>
  <p>Test class</p>
  <pre><code>class Test {
  
  @InjectMocks
  A classUnderTest;
  
  @Test 
  public void tests(){
    classUnderTest.setValues(new Person());
  // What to do next to verfiy that the setFirstName and setLastName where really called on Person Object as setValues have void return type??
  }
  }
  </code></pre>
  <p><b>Now i want to test this setValues method with void return type.</b> I know if return type would have been Person I could have used assert. But I cannot change method defination.
  So I want to verify that the call to setFirstName and setlastName is made. <br/>
  <b>I am using pit-test and the mutation removed call to setFirstName and setlastName is not getting KILLED.</b>
  <br> How can I achieve this ?? <br/></p>