### Question:
WorkerGroupService extends BaseService { public Map<String,Object> queryAllGroupPaging(User loginUser, Integer pageNo, Integer pageSize, String searchVal) { Integer fromIndex = (pageNo - 1) * pageSize; Integer toIndex = (pageNo - 1) * pageSize + pageSize; Map<String, Object> result = new HashMap<>(); if (checkAdmin(loginUser, result)) { return result; } List<WorkerGroup> workerGroups = getWorkerGroups(true); List<WorkerGroup> resultDataList = new ArrayList<>(); if (CollectionUtils.isNotEmpty(workerGroups)){ List<WorkerGroup> searchValDataList = new ArrayList<>(); if (StringUtils.isNotEmpty(searchVal)){ for (WorkerGroup workerGroup : workerGroups){ if (workerGroup.getName().contains(searchVal)){ searchValDataList.add(workerGroup); } } }else { searchValDataList = workerGroups; } if (searchValDataList.size() < pageSize){ toIndex = (pageNo - 1) * pageSize + searchValDataList.size(); } resultDataList = searchValDataList.subList(fromIndex, toIndex); } PageInfo<WorkerGroup> pageInfo = new PageInfo<>(pageNo, pageSize); pageInfo.setTotalCount(resultDataList.size()); pageInfo.setLists(resultDataList); result.put(Constants.DATA_LIST, pageInfo); putMsg(result, Status.SUCCESS); return result; }  Map<String,Object> queryAllGroupPaging(User loginUser, Integer pageNo, Integer pageSize, String searchVal); Map<String,Object> queryAllGroup();  }### Answer:
@Test public void testQueryAllGroupPaging(){ User user = new User(); user.setUserType(UserType.ADMIN_USER); Map<String, Object> result = workerGroupService.queryAllGroupPaging(user, 1, 10, null); PageInfo<WorkerGroup> pageInfo = (PageInfo) result.get(Constants.DATA_LIST); Assert.assertEquals(pageInfo.getLists().size(),1); }