Java tutorial
//package com.java2s; // The contents of this file are subject to the Mozilla Public License import java.util.*; public class Main { /** * * * Create a set out of arguments. This is as close to an object literal as you can get in Java and very similar to * the scala Set() * * @param args items to put in a set * @param <T> type of set * @return set of items passed as arguments */ public static <T> Set<T> set(T... args) { return new HashSet<T>(Arrays.asList(args)); } }