List students= studentList.stream().collect(Collectors.collectingAndThen(
collectors.tocollection(() -> new Treeset<>(
comparator.comparing(o -> o.getAge() + o.getSex())
) ),ArrayList: :new) );
此例表示:以student 中age 和sex 组合去重;
List students= studentList.stream().collect(Collectors.collectingAndThen(
collectors.tocollection(() -> new Treeset<>(
comparator.comparing(o -> o.getAge() + o.getSex())
) ),ArrayList: :new) );
此例表示:以student 中age 和sex 组合去重;