List<Bean> list1 = new ArrayList();
List<Bean> list2 = new ArrayList();
......
list1.addAll(list2 );
//根据typeCode去重
List<FileTypesDaoDto> listNew = list.stream().collect(
Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Bean::getTypeCode))), ArrayList::new));
该方法适用于jdk8以上(用了labamda表达式)。