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