Java tutorial
//package com.java2s; import java.util.HashSet; import java.util.Set; public class Main { @SafeVarargs public static <T> Set<T> set(T... objects) { Set<T> set = new HashSet<>(); for (T t : objects) { set.add(t); } return set; } }