public static <T> ArrayList<T> removeDuplicates(ArrayList<T> list){ Set<T> set = new LinkedHashSet<>(list); return new ArrayList<T>(set); }