Iterator iter = set.iterator();
while (iter.hasNext()) {
   Object x = iter.next();
   ....
}