1、/*去重,去除重复对象(每个属性的值都一样的),需要注意的是要先重写对象
List<TestStreamModel> distinctList = list.stream().distinct().collect(Collectors.toList());
2、/*排序,按id升续排列,如果要降续则改成:(a, b) -> b.getId() - a.getId(); a和b都是变量名(可以按自己意愿取名字),都是list中的对象的实例*/
List<TestStreamModel> sortList = list.stream().sorted((a, b) -> a.getId() -b.getId()).collect(Collectors.toList());
3、/*过滤,按照自己的需求来筛选list中的数据,比如我筛选出不及格的(小于60分)的人,t为实例*/
List<TestStreamModel> filterList = list.stream().filter(t -> t.getScore() < 60).collect(Collectors.toList());
4、 /*map, 提取对象中的某一元素,例子中我取的是每个人的name,注意list中类型对应,如果取的是id或者班级,就应该是integer类型*/
List<String> mapList = list.stream().map(t -> t.getName()).collect(Collectors.toList());
5、/*统