DawgHouseClient extends DawgClient implements IDawgHouseClient<MetaStb> { @Override public Collection<MetaStb> getAll() { Collection<MetaStb> stbs = new ArrayList<>(); try { @SuppressWarnings("unchecked") Map<String, Object>[] maps = client.get("/devices/list/", Map[].class); for(Map<String,Object> map : maps) { stbs.add(new MetaStb(map)); } } catch (HttpException e) { e.printStackTrace(); } return stbs; } DawgHouseClient();  DawgHouseClient(String baseURL); @Override MetaStb getById(String id); @Override void add(MetaStb stb); @Override void delete(String id); @Override Collection<MetaStb> getByIds(Collection<String> ids); @Override Collection<MetaStb> getByQuery(String query); @Override void deleteByIds(Collection<String> ids); @Override void delete(MetaStb stb); @Override void delete(Collection<MetaStb> stbs); @Override void add(Collection<MetaStb> stbs); @Override void update(MetaStb stb); @Override void update(Collection<String> id, Map<String, Object> data); @Override Collection<MetaStb> getAll(); DawgModel[] getDawgModels(String... modelNames);  }
@SuppressWarnings("unchecked") @Test public void testConstructor() throws HttpException { RestClient mockClient = EasyMock.createMock(RestClient.class); DawgHouseClient client = new DawgHouseClient(URL); client.setClient(mockClient); Map[] maps = new HashMap[1]; maps[0] = new HashMap<>(); EasyMock.expect(mockClient.get((String) EasyMock.anyObject(),(Class<Map[]>)EasyMock.anyObject())).andReturn(maps); EasyMock.replay(mockClient); Assert.assertNotNull(client.getAll()); }