### Question:
HostgroupClient { @SuppressWarnings("unchecked") public List<String> delete(List<String> groupids) { if (groupids == null || groupids.isEmpty()) { throw new IllegalArgumentException("groupid is required."); } JSONArray params; if (accessor.checkVersion("2.0") < 0) { List<Map<String, String>> list = new ArrayList<Map<String, String>>(); for (String groupid : groupids) { Map<String, String> map = new HashMap<String, String>(); map.put("groupid", groupid); list.add(map); } params = JSONArray.fromObject(list, defaultConfig); } else { params = JSONArray.fromObject(groupids, defaultConfig); } JSONObject result = (JSONObject) accessor.execute("hostgroup.delete", params); JSONArray hostgroupids = result.getJSONArray("groupids"); JsonConfig config = defaultConfig.copy(); config.setCollectionType(List.class); config.setRootClass(String.class); return (List<String>) JSONArray.toCollection(hostgroupids, config); } HostgroupClient(ZabbixAccessor accessor, JsonConfig defaultConfig); @SuppressWarnings("unchecked") List<Hostgroup> get(HostgroupGetParam param); @SuppressWarnings("unchecked") List<String> create(HostgroupCreateParam param); @SuppressWarnings("unchecked") List<String> update(HostgroupUpdateParam param); @SuppressWarnings("unchecked") List<String> delete(List<String> groupids);  }### Answer:
@Test public void testDeleteIllegalArgument() { try { client.hostgroup().delete(null); fail(); } catch (IllegalArgumentException ignore) { log.trace(ignore.getMessage()); } }
@Test public void testDeleteNotExist() { try { client.hostgroup().delete(Arrays.asList("999999")); fail(); } catch (Exception ignore) { log.trace(ignore.getMessage()); } }