jdk1.8 List根据时间字段倒序排序

List<Template> template = this.templateService.findTemplate(directoryUuid);
if(template!=null && template.size()>0){
template =

template.stream().sorted(Comparator.comparing(Template::getCreateDate).reversed()).collect(Collectors.toList());
}

原文地址:https://www.cnblogs.com/hxd9588/p/15699370.html