// 根據name去重 List<Person> unique = persons.stream().collect( Collectors.collectingAndThen( Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Person::getName))), ArrayList::new) );
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/228020.html
標籤:Java
