Comparator.comparing(ResLink::getGmtModified).reversed() 与 sorted((str1, str2) -> str1.compareTo(str2))均可以做比较
HashSet<String> hashSet = sysHospitalizationList.stream()
.map(sysHospitalization -> sysHospitalization.gethBed())
.filter(str -> !str.equals("") && !str.equals(" "))
.collect(Collectors.toCollection(HashSet::new));
List<String> bedList = hashSet.stream()
.sorted((str1, str2) -> str1.compareTo(str2))
.collect(Collectors.toList());
return bedList;
List<AdminUserDTO> resultList = sysUserDao.selectAll();
resultList .sort(Comparator.comparing(AdminUserDTO::getpName).reversed());