public  <T> List<T> removeDuplicateKeepOrder(List<T> list){
/* Set set = new HashSet();
List<T> newList = new ArrayList<T>();
for (T element : list) {
if (set.add(element)) newList.add(element);
}
//list.clear();
//list.addAll(newList);
//return list;
  return newList;*/
return  new ArrayList<T>(new LinkedHashSet<T>(list));
}

相关文章:

  • 2021-12-03
  • 2022-01-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
  • 2021-08-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
  • 2021-08-10
  • 2021-05-27
  • 2021-10-10
相关资源
相似解决方案