### Question:
EmployeeServiceImpl implements EmployeeService { @Override public List<Tuple> groupByName(String name) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<Tuple> query = cb.createTupleQuery(); Root<Employee> root = query.from(Employee.class); Join<Employee, EmployeeDetail> join = root.join(Employee_.detail, JoinType.LEFT); query.groupBy(join.get(EmployeeDetail_.name)); if (name != null) { query.having(cb.like(join.get(EmployeeDetail_.name), "%" + name + "%")); } query.select(cb.tuple(join.get(EmployeeDetail_.name).alias("name"), cb.count(root).alias("count"))); TypedQuery<Tuple> typedQuery = em.createQuery(query); return typedQuery.getResultList(); }  @Override Page<Employee> pageBySearch(EmployeeSearch search, Pageable pageable); @Override void save(Employee employee); @Override List<Employee> listByAge(Integer age); @Override List<Employee> listByAge1(Integer age); @Override List<Tuple> groupByName(String name); @Override List<EmployeeResult> findEmployee();  }### Answer:
@Test public void groupByName() { List list = employeeService.groupByName("o"); System.out.println(list); }