title: Mockito verify post object has same values not same object reference
body: <p>This is my test:</p>
  
  <pre><code>    @Test
      public void shouldProcessRegistration() throws Exception {
          Spitter unsaved = new Spitter("Gustavo", "Diaz", "gdiaz", "gd123");
          Spitter saved = new Spitter(24L, "Gustavo", "Diaz", "gdiaz", "gd123");
          SpitterRepository spittlerRepository = Mockito.mock(SpitterRepository.class);
          Mockito.when(spittlerRepository.save(unsaved)).thenReturn(saved);
  
          SpitterController spittleController = new SpitterController(spittlerRepository);
  
          MockMvc mockSpittleController = MockMvcBuilders.standaloneSetup(spittleController).build();
  
          mockSpittleController.perform(MockMvcRequestBuilders.post("/spitter/register")
                  .param("firstName", "Gustavo")
                  .param("lastName", "Diaz")
                  .param("userName", "gdiaz")
                  .param("password", "gd123"))
                  .andExpect(MockMvcResultMatchers.redirectedUrl("/spitter/" + saved.getUserName()));
  
          Mockito.verify(spittlerRepository, Mockito.atLeastOnce()).save(unsaved);
      }
  </code></pre>
  
  <p>This is my controller:</p>
  
  <pre><code>@Controller
  @RequestMapping(value = "spitter")
  public class SpitterController {
      SpitterRepository spitterRepository;
  
      @Autowired
      public SpitterController(SpitterRepository spittlerRepository) {
          this.spitterRepository = spittlerRepository;
      }
  
      @RequestMapping(value = "/register", method = RequestMethod.POST)
      public String processRegistration(Spitter spitter){
          spitterRepository.save(spitter);
  
          return "redirect:/spitter/" + spitter.getUserName();
      }
  }
  </code></pre>
  
  <p>I want to verify that <code>spitterRepository.save</code> was called passing the same <code>unsaved</code> object I defined in the test. But i'm getting this exception: </p>
  
  <pre><code>Argument(s) are different! Wanted:
  spitterRepository.save(
      spittr.Spitter@3bd82cf5
  );
  -&gt; at spitter.controllers.test.SpitterControllerTest.shouldProcessRegistration(SpitterControllerTest.java:48)
  Actual invocation has different arguments:
  spitterRepository.save(
      spittr.Spitter@544fa968
  );
  </code></pre>