### Question:
UserDao extends BaseDao<User> implements UserStore { public List<User> findByRoleId(String roleId) { Criteria criteria = currentSession().createCriteria(User.class); criteria.add(Restrictions.eq("roleOid", roleId)); return criteria.list(); } @Inject  UserDao(SessionFactory sessionFactory); Optional<User> findByUsername(String username); List<User> findByRoleId(String roleId); @Override Optional<? extends UserEntry> changePassword(String username, String newPassword);  }### Answer:
@Test public void findByRoleId() { super.createFrom(); List<User> users = dao.findByRoleId(roleOid); Assert.assertTrue(users.size() == 1); super.deleteFrom(users.get(0)); }