Does .asSet(...) exist in any API?

collections, java

Solution

Now with Java 8 you can do this without need of third-party framework:

Set<String> set = Stream.of("a","b","c").collect(Collectors.toSet());

See Collectors.

Enjoy!

Problem

I'm looking for a very simple way to create a Set. `Arrays.asList("a", "b" ...)` creates a `List<String>` Is there anything similar for `Set` ?

Original source

Related problems