### Question:
AuthResourceInMemoryDao implements AuthResourceDao { @Override public List<AuthResource> readAll(String resourceType, String ownerId) { Map<String, AuthResource> resourceMap = inMemoryResourceMap.row(resourceType); if (Objects.nonNull(resourceMap)) { Collection<AuthResource> authResources = resourceMap.values(); return authResources.stream() .filter(authResource -> authResource.getOwner().equals(ownerId)) .collect(Collectors.toList()); } return Collections.emptyList(); }  @Override void persist(AuthResource authResource); @Override void update(AuthResource authResource); @Override boolean delete(String resourceType, String resource); @Override AuthResource read(String resourceType, String resource); @Override List<AuthResource> readAll(String resourceType, String ownerId); @Override List<AuthResource> readAll(String resourceType, String action, String ownerId, List<String> userGroups); @Override boolean isExists(String resourceType, String resourceName); @Override boolean updateOwner(String resourceType, String resourceName, String newOwner); @Override boolean addGroups(String resourceType, String resourceName, String action, List<String> groups); @Override boolean removeGroup(String resourceType, String resourceName, String action, String group);  }### Answer:
@Test(priority = 1) public void testReadAllByGroups() throws AuthServerException { List<AuthResource> exchanges = authResourceDao.readAll(ResourceType.EXCHANGE.toString(), "bind", "customer", Collections.singletonList("developer")); List<AuthResource> queues = authResourceDao.readAll(ResourceType.QUEUE.toString(), "bind", "customer", Arrays.asList("architect", "designer")); Assert.assertEquals(exchanges.size(), 1); Assert.assertEquals(queues.size(), 1); }
@Test(priority = 1) public void testReadAll() throws AuthServerException { List<AuthResource> customer = authResourceDao.readAll(ResourceType.QUEUE.toString(), "customer"); List<AuthResource> customerExchange = authResourceDao.readAll(ResourceType.EXCHANGE.toString(), "customer"); List<AuthResource> manager = authResourceDao.readAll(ResourceType.EXCHANGE.toString(), "manager"); List<AuthResource> developer = authResourceDao.readAll(ResourceType.EXCHANGE.toString(), "developer"); Assert.assertEquals(customer.size(), 1); Assert.assertEquals(customerExchange.size(), 0); Assert.assertEquals(manager.size(), 2); Assert.assertEquals(developer.size(), 0); }