### Question:
UserHibernateDao extends GenericDao<JCUser> implements UserDao { @Override public JCUser getByEmail(String email) { return (JCUser) session().createCriteria(JCUser.class) .add(Restrictions.eq("email", email)) .uniqueResult(); } UserHibernateDao(SessionFactory sessionFactory); @Override User getCommonUserByUsername(String username); @SuppressWarnings("unchecked") @Override JCUser getByUsername(String username); @Override JCUser getByEmail(String email); @SuppressWarnings("unchecked") @Override Collection<JCUser> getNonActivatedUsers(); @Override JCUser getByUuid(String uuid); @Override List<JCUser> getByUsernames(Set<String> usernames); @SuppressWarnings("unchecked") @Override List<String> getUsernames(String pattern, int count); @SuppressWarnings("unchecked") @Override List<JCUser> findByUsernameOrEmail(String pattern, int count); @Override JCUser loadById(Long id); @SuppressWarnings("unchecked") @Override List<UserDto> findByUsernameOrEmailNotInGroup(String pattern, long groupId, int count);  }### Answer:
@Test public void testFetchByEMail() { JCUser user = ObjectsFactory.getDefaultUser(); session.save(user); assertNotNull(userDao.getByEmail(user.getEmail())); }