code:     public void changePassword_Returns422UnprocessableEntity_NewPasswordSameAsOld() throws Exception {
  
          Mockito.reset(passwordValidator);
  
          when(expiringCodeStore.retrieveCode("emailed_code"))
              .thenReturn(new ExpiringCode("emailed_code", new Timestamp(System.currentTimeMillis()+ UaaResetPasswordService.PASSWORD_RESET_LIFETIME), "eyedee", null));
  
          ScimUser scimUser = new ScimUser("eyedee", "user@example.com", "User", "Man");
          scimUser.setMeta(new ScimMeta(new Date(System.currentTimeMillis()-(1000*60*60*24)), new Date(System.currentTimeMillis()-(1000*60*60*24)), 0));
          scimUser.addEmail("user@example.com");
          scimUser.setVerified(true);
  
          when(scimUserProvisioning.retrieve("eyedee")).thenReturn(scimUser);
          when(scimUserProvisioning.checkPasswordMatches("eyedee", "new_secret")).thenReturn(true);
  
          MockHttpServletRequestBuilder post = post("/password_change")
              .contentType(APPLICATION_JSON)
              .content("{\"code\":\"emailed_code\",\"new_password\":\"new_secret\"}")
              .accept(APPLICATION_JSON);
  
          SecurityContextHolder.getContext().setAuthentication(new MockAuthentication());
  
          mockMvc.perform(post)
                  .andExpect(status().isUnprocessableEntity())
                  .andExpect(content().string(JsonObjectMatcherUtils.matchesJsonObject(new JSONObject().put("error_description", "Your new password cannot be the same as the old password.").put("message", "Your new password cannot be the same as the old password.").put("error", "invalid_password"))));
      }
  