對象集合去重
// 根據id去重
List<Person> unique = queryRes.stream().collect(
Collectors.collectingAndThen(
Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparingInt(Person::getId))
),
ArrayList::new
)
);