OHHAI OHHAI - 10 months ago 44
Java Question

Easiest way to convert a List to a Set in Java

What is the easiest way to convert a

List
to a
Set
in Java?

Answer
Set<Foo> foo = new HashSet<Foo>(myList);