Get Enumeration over Java HashSet
import java.util.Collections; import java.util.Enumeration; import java.util.HashSet; public class Main { public static void main(String[] args) { HashSet<String> hashSet = new HashSet<String>(); hashSet.add("A"); hashSet.add("B"); hashSet.add("D"); hashSet.add("E"); hashSet.add("F"); Enumeration e = Collections.enumeration(hashSet); while (e.hasMoreElements()) System.out.println(e.nextElement()); } }