Not HashSet, because it uses the hashCode() value of the keys, and that will be different for the different letter cases. But you could use TreeSet, which will do all comparisons using a Comparator you supply. Use String.CASE_INSENSITIVE_ORDER for the comparator and you're good to go!