### Question:
UserHibernateDao extends GenericDao<JCUser> implements UserDao { @Override public JCUser getByUuid(String uuid) { return (JCUser) session().createCriteria(JCUser.class) .add(Restrictions.eq("uuid", uuid)) .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 testGetByUuid() { JCUser user = ObjectsFactory.getDefaultUser(); String uuid = user.getUuid(); session.save(user); JCUser result = userDao.getByUuid(uuid); assertReflectionEquals(user, result); }
@Test public void testGetByUuidNotExist() { JCUser user = ObjectsFactory.getDefaultUser(); session.save(user); JCUser result = userDao.getByUuid("uuid"); assertNull(result); }