### Question:
GroupHibernateDao extends GenericDao<Group> implements GroupDao { @SuppressWarnings("unchecked") @Override public List<PoulpeBranch> getModeratingBranches(Group group) { Query query = session().getNamedQuery(FIND_BRANCHES_MODERATED_BY_GROUP); query.setLong(0, group.getId()); return query.list(); } GroupHibernateDao(SessionFactory sessionFactory); @Override @SuppressWarnings("unchecked") List<Group> getAll(); @SuppressWarnings("unchecked") @Override List<Group> getByNameContains(String name); @Override List<Group> getByName(String name); @Override void delete(Group group); @SuppressWarnings("unchecked") @Override List<PoulpeBranch> getModeratingBranches(Group group);  }### Answer:
@Test public void testGetModeratingBranches() { PoulpeBranch branch = TestFixtures.branch(); Group group = new Group("name", "description"); branch.setModeratorsGroup(group); saveAndEvict(branch); List<PoulpeBranch> actual = dao.getModeratingBranches(group); assertEquals(actual.get(0), branch); }
@Test public void testGetModeratingBranchesNotModeratorGroup() { Group group = TestFixtures.group(); saveAndEvict(group); List<PoulpeBranch> actual = dao.getModeratingBranches(group); assertEquals(actual.size(), 0); }