// With Class Type Set<String> set = new HashSet<>(Arrays.asList("a", "b", "c")); //Anonymous Class Set<String> set = new HashSet<String>(){{ add("a"); add("b"); add("c"); }};