### Question:
APIUser extends ConsoleAPI<UserItem> implements APIHasAdd<UserItem>, APIHasDelete, APIHasUpdate<UserItem>,
        APIHasGet<UserItem>, APIHasSearch<UserItem> { @Override public UserItem update(final APIID id, final Map<String, String> item) { MapUtil.removeIfBlank(item, UserItem.ATTRIBUTE_PASSWORD); if (item.get(UserItem.ATTRIBUTE_PASSWORD) != null) { checkPasswordRobustness(item.get(UserItem.ATTRIBUTE_PASSWORD)); } return getUserDatastore().update(id, item); }  @Override String defineDefaultSearchOrder(); @Override UserItem add(final UserItem item); @Override UserItem update(final APIID id, final Map<String, String> item); @Override UserItem get(final APIID id); @Override ItemSearchResult<UserItem> search(final int page, final int resultsByPage, final String search, final String orders,
            final Map<String, String> filters); @Override void delete(final List<APIID> ids);  }### Answer:
@Test public void should_not_update_password_if_empty() throws Exception { apiUser.update(USER_ID, map(UserItem.ATTRIBUTE_PASSWORD, "")); verify(userDatastore).update(eq(USER_ID), eq(Collections.<String, String> emptyMap())); }
@Test public void should_check_password_robustness_on_update() throws Exception { expectedException.expect(ValidationException.class); expectedException.expectMessage("the validator TestValidator rejected this password"); apiUser.update(USER_ID, map(UserItem.ATTRIBUTE_PASSWORD, "this password is not accepted by the TestValidator validator")); }
@Test public void should_update_password_if_valid() throws Exception { apiUser.update(USER_ID, map(UserItem.ATTRIBUTE_PASSWORD, "accepted password")); verify(userDatastore).update(eq(USER_ID), eq(map(UserItem.ATTRIBUTE_PASSWORD, "accepted password"))); }