1.简单的filter和map的单独形式
Listnewlist = list.stream().map(Person::getName).collect(toList());
list = list.stream().filter(person -> person.getAge() == 20).collect(toList());
2.map与filter的位置互换
ListcidList = userInfoEntities.stream().map(SisTspUserInfoEntity::getCid).filter(StringUtils::isNotBlank).distinct().collect(Collectors.toList());
ListcidList1 = userInfoEntities.stream().filter(x->x.getUserId() != 1).map(SisTspUserInfoEntity::getCid).distinct().collect(Collectors.toList());
3.distinct的一般过滤形式
ListphoneList5 = entities.stream().distinct().collect(Collectors.toList());
4.StreamEx过滤 合并多个stream
ListphoneList6 = StreamEx.of(entities).distinct(SisTspVehicleOwnerRecordEntity::getPhoneNumber).collect(Collectors.toList());
5.distinctByKey在使用filter时需要重定义
Listobj = refactorList.stream().filter(distinctByKey(basePlatFormReport::getVin)).collect(Collectors.toList());
private staticPredicate distinctByKey(Function super T, ?> keyExtractor) { Map



