### Question:
EmployeeServiceImpl implements EmployeeService { @Override public Page<Employee> pageBySearch(EmployeeSearch search, Pageable pageable) { return employeeDao.findAll((Specification<Employee>) (root, criteriaQuery, criteriaBuilder) -> { List<Predicate> predicates = new LinkedList<>(); Optional<EmployeeSearch> optional = Optional.ofNullable(search); optional.map(EmployeeSearch::getEmployeeId).ifPresent(id -> { predicates.add(criteriaBuilder.equal(root.get(Employee_.id), id)); }); optional.map(EmployeeSearch::getEmployeeName).ifPresent(name -> { Join<Employee, EmployeeDetail> join = root.join(Employee_.detail, JoinType.LEFT); predicates.add(criteriaBuilder.like(join.get(EmployeeDetail_.name), "%" + name + "%")); }); optional.map(EmployeeSearch::getJobName).ifPresent(name -> { Join<Employee, Job> join = root.join(Employee_.job, JoinType.LEFT); predicates.add(criteriaBuilder.equal(join.get(Job_.name), name)); }); Predicate[] array = new Predicate[predicates.size()]; return criteriaBuilder.and(predicates.toArray(array)); }, pageable); }  @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 testPageBySearch() throws Exception { EmployeeSearch employeeSearch = new EmployeeSearch(null, null, "程序猿"); Sort sort = new Sort(Sort.Direction.ASC, "id"); Page<Employee> employees = employeeService.pageBySearch(employeeSearch, new PageRequest(0, 5, sort)); Assert.assertThat("18772383543", Matchers.equalTo(employees.getContent().get(0).getDetail().getPhone())); }