### Question:
SoapSecurityService extends AbstractService implements SecurityService { @Override public WSUser[] listUsers(String sid, String group) throws Exception { User user = validateSession(sid); try { List<WSUser> users = new ArrayList<WSUser>(); UserDAO dao = (UserDAO) Context.get().getBean(UserDAO.class); if (StringUtils.isEmpty(group)) { for (User usr : dao.findAll(user.getTenantId())) { dao.initialize(user); if (usr.getType() == User.TYPE_DEFAULT) users.add(WSUser.fromUser(usr)); } } else { GroupDAO gDao = (GroupDAO) Context.get().getBean(GroupDAO.class); Group grp = gDao.findByName(group, user.getTenantId()); gDao.initialize(grp); for (User usr : grp.getUsers()) { dao.initialize(user); if (usr.getType() == User.TYPE_DEFAULT) users.add(WSUser.fromUser(usr)); } } if (!user.isMemberOf("admin")) for (WSUser usr : users) { usr.setUsername(null); usr.setEmail(null); usr.setEmail2(null); usr.setPassword(null); usr.setPasswordmd4(null); usr.setPostalcode(null); usr.setStreet(null); usr.setTelephone(null); usr.setTelephone2(null); } return users.toArray(new WSUser[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 testListUsers() throws Exception { WSUser[] users = securityServiceImpl.listUsers("",null); Assert.assertNotNull(users); Assert.assertEquals(5, users.length); List<WSUser> usersList = Arrays.asList(users); Assert.assertEquals(1, usersList.get(0).getId()); Assert.assertEquals(2, usersList.get(1).getId()); Assert.assertEquals("boss", usersList.get(1).getUsername()); }