流去重
Listarrays = arr.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Entity :: getId))), ArrayList::new));

流去重
Listarrays = arr.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Entity :: getId))), ArrayList::new));