//对于Map的值,先将PutTarget转换为CoursePutApply,然后调用toList()Map>result1=this.putTargets.stream().collect(Collectors.groupingBy(PutTarget::getCity,Collectors.mapping((PutTargetputTarget)->newCoursePutApply(),toList())));//对于Map的值,先调用toList(),然后将PutTarget转换为CoursePutApplyMapresult2=this.putTargets.stream().collect(Collectors.groupingBy(PutTarget::getCity,Collectors.collectingAndThen(toList(),(Listlist)->newCoursePutApply(this.courseId,list))));