### Question:
UsergroupClient { @SuppressWarnings("unchecked") public List<String> update(UsergroupUpdateParam param) { if (param.getUsrgrpid() == null || param.getUsrgrpid().length() == 0) { throw new IllegalArgumentException("usrgrpid is required."); } JSONObject params = JSONObject.fromObject(param, defaultConfig); if (accessor.checkVersion("2.0") >= 0) { if (params.containsKey("api_access")) { params.remove("api_access"); } } JSONObject result = (JSONObject) accessor.execute("usergroup.update", params); JSONArray usrgrpids = result.getJSONArray("usrgrpids"); JsonConfig config = defaultConfig.copy(); config.setCollectionType(List.class); config.setRootClass(String.class); return (List<String>) JSONArray.toCollection(usrgrpids, config); } UsergroupClient(ZabbixAccessor accessor, JsonConfig defaultConfig); @SuppressWarnings("unchecked") List<Usergroup> get(UsergroupGetParam param); @SuppressWarnings("unchecked") List<String> create(UsergroupCreateParam param); List<String> massAdd(UsergroupMassAddParam param); @SuppressWarnings("unchecked") List<String> update(UsergroupUpdateParam param); @SuppressWarnings("unchecked") List<String> delete(List<String> usrgrpids);  }### Answer:
@Test public void testUpdateIllegalArgument() { UsergroupUpdateParam param = new UsergroupUpdateParam(); try { client.usergroup().update(param); fail(); } catch (IllegalArgumentException ignore) { log.trace(ignore.getMessage()); } }
@Test public void testUpdateNotExist() { UsergroupUpdateParam param = new UsergroupUpdateParam(); param.setUsrgrpid("999999"); try { client.usergroup().update(param); } catch (Exception ignore) { log.trace(ignore.getMessage()); } }