Java tutorial
//package com.java2s; /* * Hibernate Validator, declare and validate application constraints * * License: Apache License, Version 2.0 * See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>. */ import java.util.Arrays; import java.util.HashSet; import java.util.Set; public class Main { @SafeVarargs public static <T> Set<T> asSet(T... ts) { return new HashSet<>(Arrays.asList(ts)); } }