### Question:
ItemClient { @SuppressWarnings("unchecked") public List<Item> get(ItemGetParam param) { JSONObject params = JSONObject.fromObject(param, defaultConfig); JSONArray result = (JSONArray) accessor.execute("item.get", params); JsonConfig config = defaultConfig.copy(); config.setCollectionType(List.class); config.setRootClass(Item.class); config.setJavaPropertyFilter(new PropertyFilter() { @Override public boolean apply(Object source, String name, Object value) { if ("hosts".equals(name)) { return true; } return false; } }); return (List<Item>) JSONArray.toCollection(result, config); } ItemClient(ZabbixAccessor accessor, JsonConfig defaultConfig); @SuppressWarnings("unchecked") List<Item> get(ItemGetParam param); @SuppressWarnings("unchecked") List<String> update(ItemUpdateParam param); List<String> delete(List<String> itemids);  }### Answer:
@Test public void testGetAll() { ItemGetParam param = new ItemGetParam(); param.setHostids(Arrays.asList("10001")); param.setOutput("extend"); List<Item> items = client.item().get(param); for (Item item : items) { log.trace(ReflectionToStringBuilder.toString(item, ToStringStyle.SHORT_PREFIX_STYLE)); } assertTrue(items.size() > 0); }
@Test public void testGet() { ItemGetParam param = new ItemGetParam(); param.setItemids(Arrays.asList("10009")); param.setOutput("extend"); List<Item> items = client.item().get(param); assertTrue(items.size() > 0); assertEquals(1, items.size()); assertEquals("10009", items.get(0).getItemid()); }
@Test public void testGetByApplication() { List<Item> items; { ItemGetParam param = new ItemGetParam(); param.setHostids(Arrays.asList("10001")); param.setOutput("extend"); items = client.item().get(param); assertTrue(items.size() > 0); } List<Item> items2; { ItemGetParam param = new ItemGetParam(); param.setHostids(Arrays.asList("10001")); param.setApplication("OS"); param.setOutput("extend"); items2 = client.item().get(param); assertTrue(items2.size() > 0); } assertTrue(items.size() > items2.size()); }