Java笔记第一弹、Stream常用方法
//list对象取某个字段
List vehicleIds = list.stream().map(OcCarebasePO::getVehicleId).collect(Collectors.toList());
//list对象转map-重复取后者
Map map = list.getResult().stream().collect(Collectors.toMap(Vehicle3VO::getVehicleID, Vehicle3VO::getVehicleBrand(), (a, b) -> b));
//list对象转map-重复合并为list
Map> map = list.stream().collect(Collectors.groupingBy(OcCareRulePO::getVehicleBrandDic));
// 根据name去重
List unique = persons.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Person::getName))), ArrayList::new));
//过滤空值
List repairFactoryIds = list.stream().filter(l -> Objects.nonNull(l.getRepairFactoryId())).collect(Collectors.toList());



