// 返回的List是无序
HashSet<String> set = new HashSet<String>(list);
list.clear();
list.addAll(set);
return list;
// 返回的List是有序
LinkedHashSet<String> set = new LinkedHashSet<String>(list);
list.clear();
list.addAll(set);
return list;
网友评论