1public static <T> List<T> removeDuplicates(List<T> list){
2 Set<T> set = new LinkedHashSet<>(list);
3 return new ArrayList<T>(set);
4}
1public static <T> ArrayList<T> removeDuplicates(ArrayList<T> list){
2 Set<T> set = new LinkedHashSet<>(list);
3 return new ArrayList<T>(set);
4}