假定按照Number对象的Id字段进行排序
正序排序
Collections.sort(resultList, Comparator.comparing(Number::getId));
逆序排序
Collections.sort(resultList, Comparator
.comparing(Number::getId, Comparator.reverseOrder()));
标签:sort,Comparator,Number,resultList,Collections,排序,写法
From: https://www.cnblogs.com/MorningBell/p/16659416.html