// 获取分页查询的实体类集合
List<PcCmsContentListVO> contentList = page.getRecords();
// 转成stream流
contentList = contentList.stream()
.sorted(Comparator.comparing(PcCmsContentListVO::getApplicationTime, Comparator.nullsFirst(Instant::compareTo))
.reversed()).collect(Collectors.toList());
Comparator.nullsFirst(Instant::compareTo)这个是来判断是否为null,为null排在最前面。
reversed()这个是为倒序方法。
.collect(Collectors.toList())这个是将stream流转成集合