title: Mockito mocking method with class parameter vs actual object parameter
body: <p>What is the difference between these two as per Mockito -</p>
  
  <blockquote>
    <p>Mockito.when(serviceObject.myMethod(Customer.class)).thenThrow(new
    RuntimeException());</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>Customer customer = new Customer();
    Mockito.when(serviceObject.myMethod(customer)).thenThrow(new
    RuntimeException());</p>
  </blockquote>
  
  <p>And if both serve the same purpose then using which one is considered to be best practice?</p>