### Question:
GroupHibernateDao extends GenericDao<Group> implements GroupDao { @SuppressWarnings("unchecked") @Override public List<GroupAdministrationDto> getGroupNamesWithCountOfUsers() { return (List<GroupAdministrationDto>) session().getNamedQuery("selectGroupsWithUserCount").list(); } GroupHibernateDao(SessionFactory sessionFactory); @Override @SuppressWarnings("unchecked") List<Group> getAll(); @SuppressWarnings("unchecked") @Override List<Group> getMatchedByName(String name); @Override Group getGroupByName(String name); @Override void delete(Group group); @Override List<Group> getGroupsOfUser(User user); @Override List<Group> getGroupsByIds(List<Long> ids); @SuppressWarnings("unchecked") @Override List<Group> getByNameContains(String name); @Override List<Group> getByName(String name); @SuppressWarnings("unchecked") @Override List<GroupAdministrationDto> getGroupNamesWithCountOfUsers(); @Override List<UserDto> getGroupUsersPage(long id, PageRequest pageRequest); @Override int getGroupUserCount(long id);  }### Answer:
@Test public void listOfGroupsMustBeSortedAlphabetically() throws ParseException{ if (isMySql()){ List<GroupAdministrationDto> expected = new LinkedList<>(); for (int i = 0; i < 10; i++) { Group en = new Group(alphanumeric(MIN_GROUP_NAME_LENGTH, MAX_GROUP_NAME_LENGTH)); Group ru = new Group(between(MIN_GROUP_NAME_LENGTH, MAX_GROUP_NAME_LENGTH).string(DICTIONARY_RU)); saveAndEvict(en); saveAndEvict(ru); expected.add(new GroupAdministrationDto(en.getName(), en.getUsers().size())); expected.add(new GroupAdministrationDto(ru.getName(), ru.getUsers().size())); } sortByName(expected); List<GroupAdministrationDto> actual = groupDao.getGroupNamesWithCountOfUsers(); assertReflectionEquals(expected, actual); } }