Java tutorial
//package com.java2s; /* * This file is part of the jasm project (http://code.google.com/p/jasm). * * This file is licensed to you under the BSD License; You may not use * this file except in compliance with the License. See the LICENSE.txt * file distributed with this work for a copy of the License and information * regarding copyright ownership. */ import java.util.Arrays; import java.util.HashSet; import java.util.Set; public class Main { public static <Element_Type> Set<Element_Type> hashSetFrom(Element_Type... elements) { return new HashSet<Element_Type>(Arrays.asList(elements)); } }