arrayEntity:自定义对象
list:对象List集合
//根据channelNo字段去重
ArrayList<arrayEntity> collect = list.stream().collect(Collectors.collectingAndThen
(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(arrayEntity::getChannelNo))), ArrayList::new));
//根据id和jobId去重
ArrayList<arrayEntity> collect1 = list.stream().collect(Collectors.collectingAndThen
(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o->o.getId() + ";" + o.getJobId()))), ArrayList::new));