### Question:
UserHibernateDao extends GenericDao<JCUser> implements UserDao { @SuppressWarnings("unchecked") @Override public Collection<JCUser> getNonActivatedUsers() { return session().createCriteria(JCUser.class) .add(Restrictions.eq("enabled", false)) .list(); } 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 testFetchNonActivatedAccounts() { JCUser activated = new JCUser("login", "email@mail.com", "password"); activated.setEnabled(true); JCUser nonActivated = ObjectsFactory.getDefaultUser(); session.save(activated); session.save(nonActivated); Collection<JCUser> users = userDao.getNonActivatedUsers(); assertTrue(users.contains(nonActivated)); assertEquals(users.size(), 1); }