### Question:
SoapSecurityService extends AbstractService implements SecurityService { @Override public WSGroup[] listGroups(String sid) throws Exception { checkAdministrator(sid); User user = validateSession(sid); try { List<WSGroup> groups = new ArrayList<WSGroup>(); GroupDAO dao = (GroupDAO) Context.get().getBean(GroupDAO.class); for (Group grp : dao.findAll(user.getTenantId())) { if (grp.getType() == Group.TYPE_DEFAULT) { dao.initialize(grp); groups.add(WSGroup.fromGroup(grp)); } } return groups.toArray(new WSGroup[0]); } catch (Throwable t) { log.error(t.getMessage(), t); throw new Exception(t.getMessage()); } }  @Override WSUser[] listUsers(String sid, String group); @Override WSGroup[] listGroups(String sid); @Override long storeUser(String sid, WSUser user); @Override long storeGroup(String sid, WSGroup group); @Override void deleteUser(String sid, long userId); @Override void deleteGroup(String sid, long groupId); @Override int changePassword(String sid, long userId, String oldPassword, String newPassword); @Override WSUser getUser(String sid, long userId); @Override WSUser getUserByUsername(String sid, String username); @Override WSGroup getGroup(String sid, long groupId);  }### Answer:
@Test public void testListGroups() throws Exception { WSGroup[] groups = securityServiceImpl.listGroups(""); Assert.assertNotNull(groups); Assert.assertEquals(6, groups.length); List<WSGroup> groupsList = Arrays.asList(groups); WSGroup dummy = new WSGroup(); dummy.setId(1); Assert.assertTrue(groupsList.contains(dummy)); dummy.setId(2); Assert.assertTrue(groupsList.contains(dummy)); Assert.assertEquals("Group of authors", groupsList.get(groupsList.indexOf(dummy)).getDescription()); }