listA = listA.stream().collect(
Collectors.collectingAndThen(
Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(ADTO::getId))),
ArrayList::new));
listA = listA.stream().collect(
Collectors.collectingAndThen(
Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(ADTO::getId))),
ArrayList::new));