//按照List中對象的fileKind屬性排序
PathInfoList.sort(Comparator.comparing(PathInfo::getFilekind));
//按照List中對象的fileKind屬性倒轉排序 ,添加reversed()方法
PathInfoList.sort(Comparator.comparing(PathInfo::getFilekind).reversed());
原文鏈接:https://blog.csdn.net/sayoko06/article/details/88290421