### Question:
ApplicationClient { @SuppressWarnings("unchecked") public List<Application> get(ApplicationGetParam param) { JSONObject params = JSONObject.fromObject(param, defaultConfig); JSONArray result = (JSONArray) accessor.execute("application.get", params); JsonConfig config = defaultConfig.copy(); config.setCollectionType(List.class); config.setRootClass(Application.class); config.getClassMap().put("hosts", Host.class); return (List<Application>) JSONArray.toCollection(result, config); } ApplicationClient(ZabbixAccessor accessor, JsonConfig defaultConfig); @SuppressWarnings("unchecked") List<Application> get(ApplicationGetParam param);  }### Answer:
@Test public void testGetAll() { ApplicationGetParam param = new ApplicationGetParam(); param.setOutput("extend"); List<Application> applications = client.application().get(param); for (Application application : applications) { log.trace(ReflectionToStringBuilder.toString(application, ToStringStyle.SHORT_PREFIX_STYLE)); } assertTrue(applications.size() > 0); }
@Test public void testGet() { ApplicationGetParam param = new ApplicationGetParam(); param.setApplicationids(Arrays.asList("1")); param.setOutput("extend"); List<Application> applications = client.application().get(param); assertEquals(1, applications.size()); assertEquals("1", applications.get(0).getApplicationid()); }
@Test public void testGetNotExist() { ApplicationGetParam param = new ApplicationGetParam(); param.setApplicationids(Arrays.asList("999999")); param.setOutput("extend"); List<Application> applications = client.application().get(param); assertEquals(0, applications.size()); }
@Test public void testGetByTemplateid() { String templateid = "10001"; ApplicationGetParam param = new ApplicationGetParam(); param.setHostids(Arrays.asList(templateid)); param.setOutput("extend"); List<Application> applications = client.application().get(param); for (Application application : applications) { log.trace(ReflectionToStringBuilder.toString(application, ToStringStyle.SHORT_PREFIX_STYLE)); } assertTrue(applications.size() > 0); }