Easiest way to convert a List to a Set in Java

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

Leave a Comment