remove duplicates in java 8 list code example
Example: java remove duplicates
public static <T> ArrayList<T> removeDuplicates(ArrayList<T> list){
Set<T> set = new LinkedHashSet<>(list);
return new ArrayList<T>(set);
}
public static <T> ArrayList<T> removeDuplicates(ArrayList<T> list){
Set<T> set = new LinkedHashSet<>(list);
return new ArrayList<T>(set);
}