Nuwan Zen

Creating a small Collection in Java is very verbose using the traditional way.

Set<String> set = new HashSet<>();
set.add("foo");
set.add("bar");
set.add("baz");

Java 9 “of” method comes to rescue us

Set<String>…