实用操作:
// 获取list列表中titleName="leo"的对象列表
List<Title> maxList = list.stream()
.filter(t -> format.format(t.getTitleName()).equals("leo"))
.collect(Collectors.toList());
// 获取微博用户列表内type=1 && 粉丝数大于50w 的对象数量
List<WbUser> list = wbUserMapper.selectListByKeyWord(keyWord);
list.stream().filter(t -> t.getType() == 1 && t.getFans() > 500000).count();
// 排序 o1-o2:升序 o2-o1 降序
// 时间排序
List<Title> list = titleMapper.selectAll(title);
list.sort((o1,o2) -> Long.compare(o2.getTitlePublishtime().getTime(),o1.getTitlePublishtime().getTime()));
// 整型
List<Integer> allCountList = statisticsByData(list);
allCountList.sort((o1,o2) -> Integer.compare(o2,o1));
//从list集合中查找是否存在某个值
list