What is the easiest way to convert a List to a Set in Java?

17 s
17

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

Leave a Reply

Your email address will not be published. Required fields are marked *