### Question:
UserHibernateDao extends GenericDao<PoulpeUser> implements UserDao { @Override public int countUsernameMatches(String searchString) { searchString = SqlLikeEscaper.escapeControlCharacters(searchString); Query query = session().getNamedQuery("countUsersByLikeUsername"); query.setString("username", MessageFormat.format(FORMAT, searchString)); Number result = (Number) query.uniqueResult(); return result.intValue(); } UserHibernateDao(SessionFactory sessionFactory); @Override List<PoulpeUser> findPoulpeUsersPaginated(String searchString, Pagination paginate); @Override List<PoulpeUser> findPoulpeUsersBySearchRequest(UserSearchRequest searchRequest); @Override int countUsernameMatches(String searchString); @Override PoulpeUser getByUsername(String username); @Override PoulpeUser getByEmail(String email); @Override PoulpeUser getByUUID(String uuid); @Override List<PoulpeUser> getUsersInGroups(List<Group> groups); @Override List<PoulpeUser> findUsersByUsernameAndPasswordHash(String username, String passwordHash); @Override List<PoulpeUser> findUsersNotInGroups(String availableFilterText,
                                                 List<Group> groups, Pagination paginate); @Override List<PoulpeUser> findUsersNotInList(String availableFilterText,
                                               List<PoulpeUser> listUsers, Pagination paginate); @Override void save(User user);  }### Answer:
@Test public void getAllUsersCount() { int count = 13; List<PoulpeUser> users = TestFixtures.usersListOf(count); saveAndEvict(users); int actual = dao.countUsernameMatches(NO_FILTER); assertEquals(actual, count); }