how to convert arraylist to hashset in java code example Example: convert array list to Hashset Set<Integer> set = new HashSet<Integer>(arrayList);