What is the easiest way to convert a List to a Set in Java?
List
Set
Set<Foo> foo = new HashSet<Foo>(myList);
2.1m questions
2.1m answers
60 comments
57.0k users