private List<Integer> getNewList(List<Integer> list){
if(null == list || list.size()<2) return list;
Set<Integer> set = new HashSet<Integer>();
List<Integer> newList = new ArrayList<Integer>();
for (Integer i:list) {
if(set.add(i)){
newList.add(i);
}
}
return newList;
}
网友评论