How to separate elements of a TwinColSelect

I have a TwinColSelect in my application. I also have a button to save the entire list in the database. On clicking the save button i invoke the getValue() method which provides me with an
unmodifiableSet
of all the values which i selected.

Now, i want to separate all the elements of this set and store it in an arraylist from where i can store it in the database.
Casting this unmodifiable set in toArrayList gives me a ClassCastException.

Any ideas???

First that comes into mind is to loop it and add entries to a list.

ArrayList list = new ArrayList();
For(Object o : mySet){
  list.add(o);
}

add generics if possible.

Edit: this works probably too:

ArrayList list = new ArrayList();
list.addAll(mySet);

Collections typically accept collections as arguments on their constructor

ArrayList list = new ArrayList(mySet);

Even better! Thanks!