title: Test Failure Message in mockito : Argument(s) are different! Wanted:
body: <p>I am testing a Restful endpoint in my JUnit and getting an exception as below in the 
  list which is present as an argument inside the save method,</p>
  
  <pre><code>**"Argument(s) are different! Wanted:"** 
  save(
  "121",
  [com.domain.PP@6809cf9d, 
  com.domain.PP@5925d603]
  );
  Actual invocation has different arguments:
  save(
  "121",
  [com.domain.PP@5b6e23fd,  
  com.domain.PP@1791fe40]
   ); 
  </code></pre>
  
  <p>When I debugged the code, the code broke at the <strong>verify</strong> line below and threw the 
  above exception. Looks like the arguments inside the "testpPList" within the save 
  method is different. I dont know how it becomes different as I construct them in my 
  JUNit properly and then RestFul URL is invoked.</p>
  
  <p>Requesting your valuable inputs. Thanks.</p>
  
  <p>Code:</p>
  
  <pre><code>@Test
  public void testSelected() throws Exception {
      mockMvc.perform(put("/endpointURL")
          .contentType(TestUtil.APPLICATION_JSON_UTF8)
          .content(TestUtil.convertObjectToJsonBytes(testObject)))
          .andExpect(status().isOk());
      verify(programServiceMock, times(1)).save(id, testpPList);
      verifyNoMoreInteractions(programServiceMock);
  }
  </code></pre>
  
  <p>Controller method:</p>
  
  <pre><code>@RequestMapping(value = "/endpointURL", method = RequestMethod.PUT)
  public @ResponseBody void uPP(@PathVariable String id, @RequestBody List&lt;PPView&gt; pPViews) {
      // Code to construct the list which is passed into the save method below
      save(id, pPList);
  }
  </code></pre>