Here you can find the source of asSet(T... items)
public static <T> Set<T> asSet(T... items)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static <T> Set<T> asSet(T... items) { Set<T> set = new LinkedHashSet<T>(); Collections.addAll(set, items); return set; }//from ww w. j a v a 2 s.c o m }