List<实体>排序
正序
list.stream() .sorted(Comparator.comparing(Entity::getId)) .collect(Collectors.toList());
倒序
list.stream() .sorted(Comparator.comparing(Entity::getId).reversed()) .collect(Collectors.toList());
List<实体>排序
正序
list.stream() .sorted(Comparator.comparing(Entity::getId)) .collect(Collectors.toList());
倒序
list.stream() .sorted(Comparator.comparing(Entity::getId).reversed()) .collect(Collectors.toList());