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.Set; import java.util.TreeSet; public class Main { public static <T> Set<T> asTreeSet(T... ts) { return new TreeSet<T>(Arrays.asList(ts)); } }