So fügen Sie einen Singleton -Hashset in Java hinzu
// 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");
}};
Blue Buffalo