### Question:
HibernateUserDAO extends HibernatePersistentObjectDAO<User> implements UserDAO { @Override public Set<User> findByGroup(long groupId) { List<Long> docIds = new ArrayList<Long>(); try { docIds = queryForList("select ld_userid from ld_usergroup where ld_groupid=" + groupId, Long.class); } catch (PersistenceException e) { log.error(e.getMessage(), e); } Set<User> set = new HashSet<User>(); if (!docIds.isEmpty()) { String query = "_entity.id in (" + StringUtil.arrayToString(docIds.toArray(new Long[0]), ",") + ")"; try { List<User> users = findByWhere(query, null, null, null); for (User user : users) { if (user.getDeleted() == 0 && !set.contains(user)) set.add(user); } } catch (PersistenceException e) { log.error(e.getMessage(), e); } } return set; } private  HibernateUserDAO(); static boolean ignoreCaseLogin(); @Override boolean delete(long userId, int code); @Override List<User> findByName(String name); @Override User findByUsername(String username); @Override User findByUsernameIgnoreCase(String username); List<User> findByLikeUsername(String username); @Override List<User> findByUsernameAndName(String username, String name); @Override boolean store(User user); @Override boolean store(User user, UserHistory transaction); boolean validateUser(String username, String password); @Override boolean validateUser(String username); int getPasswordTtl(); @Override boolean isPasswordExpired(String username); @Override int count(Long tenantId); @Override int countGuests(Long tenantId); @Override boolean delete(long userId, UserHistory transaction); UserHistoryDAO getUserHistoryDAO(); void setUserHistoryDAO(UserHistoryDAO userHistoryDAO); void setUserListenerManager(UserListenerManager userListenerManager); UserListenerManager getUserListenerManager(); @Override void initialize(User user); @Override Map<String, Generic> findUserSettings(long userId, String namePrefix); void setGenericDAO(GenericDAO genericDAO); @Override User findAdminUser(String tenantName); void setConfig(ContextProperties config); @Override Set<User> findByGroup(long groupId); @Override User findById(long id); @Override User getUser(String username);  }### Answer:
@Test public void testFindByGroup() { Set<User> users = dao.findByGroup(1L); Assert.assertNotNull(users); Assert.assertEquals(2, users.size()); Assert.assertTrue(users.contains(dao.findById(1L))); users = dao.findByGroup(99L); Assert.assertNotNull(users); Assert.assertEquals(0, users.size()); }