java8特性-list集合根据多个字段去重
//按专业和年级去重,专业和年纪一样时表示重复对象
List<Class> distinctClass = classList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getProfessionId() + ";" + o.getGrade()))), ArrayList::new));
//去重bean bean各属性全部一样会视为相同
List<String> bean = new ArrayList<>();
List<String> classNameList = new ArrayList(new HashSet(bean));