### Question:
MenuDao extends BaseDao<Menu> { public List<Menu> findHierarchicalMenu() { Criteria criteria = currentSession().createCriteria(Menu.class); criteria.add(Restrictions.isNull("parentOid")); criteria.addOrder(Order.asc("index")); return list(criteria); } @Inject  MenuDao(SessionFactory sessionFactory); List<Menu> findByModule(String names); List<Menu> findHierarchicalMenu(); List<Menu> findByParentOid(String parentOid);  }### Answer:
@Test public void findHierarchicalMenu() { List<Menu> menus = dao.findHierarchicalMenu(); Assert.assertTrue(menus.size() == 1); }