Here you can find the source of setOf(final T... items)
public static <T> Set<T> setOf(final T... items)
//package com.java2s; //License from project: Apache License import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; public class Main { public static <T> Set<T> setOf(final T... items) { return Collections.unmodifiableSet(new HashSet<T>(Arrays .asList(items)));//from w w w.ja va2 s . c o m } }