### Question:
ValidatorHibernateDao implements ValidatorDao<String> { @Override public boolean isResultSetEmpty(Class<? extends Entity> entity, String field, String param, boolean ignoreCase) { return getResultSet(entity, field, param, ignoreCase).isEmpty(); } ValidatorHibernateDao(SessionFactory sessionFactory); @Override boolean isResultSetEmpty(Class<? extends Entity> entity, String field, 
            String param, boolean ignoreCase); @Override boolean isExists(Class<? extends Entity> entity, String field, 
            String param, boolean ignoreCase);  }### Answer:
@Test public void testResultSetisEmptyNoField() { assertTrue(dao.isResultSetEmpty(JCUser.class, "username", "lol", false)); }
@Test public void testResultSetIsEmptyDifferentCases() { String realname = ObjectsFactory.getDefaultUser().getUsername().toUpperCase(); sessionFactory.getCurrentSession().saveOrUpdate(ObjectsFactory.getDefaultUser()); assertTrue(dao.isResultSetEmpty(JCUser.class, "username", realname, false)); }
@Test public void testResultSetIsNotEmptyCaseSensitive() { String realname = ObjectsFactory.getDefaultUser().getUsername(); sessionFactory.getCurrentSession().saveOrUpdate(ObjectsFactory.getDefaultUser()); assertFalse(dao.isResultSetEmpty(JCUser.class, "username", realname, false)); }
@Test public void testResultSetIsNotEmptyIgnoreCase() { String realname = ObjectsFactory.getDefaultUser().getUsername().toUpperCase(); sessionFactory.getCurrentSession().saveOrUpdate(ObjectsFactory.getDefaultUser()); assertFalse(dao.isResultSetEmpty(JCUser.class, "username", realname, true)); }