### Question:
UsergroupClient { @SuppressWarnings("unchecked") public List<Usergroup> get(UsergroupGetParam param) { JSONObject params = JSONObject.fromObject(param, defaultConfig); JSONArray result = (JSONArray) accessor.execute("usergroup.get", params); JsonConfig config = defaultConfig.copy(); config.setCollectionType(List.class); config.setRootClass(Usergroup.class); return (List<Usergroup>) JSONArray.toCollection(result, 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 testGetAll() { UsergroupGetParam param = new UsergroupGetParam(); param.setOutput("extend"); List<Usergroup> usergroups = client.usergroup().get(param); for (Usergroup usergroup : usergroups) { log.trace(ReflectionToStringBuilder.toString(usergroup, ToStringStyle.SHORT_PREFIX_STYLE)); } assertTrue(usergroups.size() > 0); }
@Test public void testGet() { UsergroupGetParam param = new UsergroupGetParam(); param.setUsrgrpids(Arrays.asList("8")); param.setOutput("extend"); List<Usergroup> usergroups = client.usergroup().get(param); assertEquals(1, usergroups.size()); assertEquals("8", usergroups.get(0).getUsrgrpid()); }
@Test public void testGetNotExist() { UsergroupGetParam param = new UsergroupGetParam(); param.setUsrgrpids(Arrays.asList("999999")); param.setOutput("extend"); List<Usergroup> usergroups = client.usergroup().get(param); assertEquals(0, usergroups.size()); }