### Question:
SecurityManagerImpl implements SecurityManager { @Override public Set<Group> getAllowedGroups(long menuId) { Menu menu = menuDAO.findById(menuId); if (menu.getSecurityRef() != null) menu = menuDAO.findById(menu.getSecurityRef()); Set<Group> groups = new HashSet<Group>(); for (MenuGroup mg : menu.getMenuGroups()) { Group group = groupDAO.findById(mg.getGroupId()); if (!groups.contains(group)) groups.add(groupDAO.findById(mg.getGroupId())); } Group admin = groupDAO.findById(Group.GROUPID_ADMIN); if (!groups.contains(admin)) groups.add(admin); return groups; } private  SecurityManagerImpl(); void setMenuDAO(MenuDAO menuDAO); void setGroupDAO(GroupDAO groupDAO); void setUserDAO(UserDAO userDAO); @Override Set<Group> getAllowedGroups(long menuId); @Override boolean isMemberOf(long userId, long groupId); @Override boolean isMemberOf(long userId, String groupName); @Override boolean isWriteEnabled(long docId, long userId); @Override boolean isReadEnabled(long docId, long userId); @Override boolean isPrintEnabled(long docId, long userId); @Override boolean isDownloadEnabled(long docId, long userId); @Override boolean isPermissionEnabled(Permission permission, long docId, long userId); @Override Set<Permission> getEnabledPermissions(long docId, long userId); void setFolderDAO(FolderDAO folderDAO); void setDocumentDAO(DocumentDAO documentDAO);  }### Answer:
@Test public void testGetAllowedGroups() { Set<Group> groups = manager.getAllowedGroups(9); Assert.assertNotNull(groups); Assert.assertTrue(groups.contains(groupDAO.findByName("admin", 1))); }