Here you can find the source of hashSetOf(T... ts)
public static <T> Set<T> hashSetOf(T... ts)
//package com.java2s; //License from project: Open Source License import java.util.Collections; import java.util.HashSet; import java.util.Set; public class Main { public static <T> Set<T> hashSetOf(T... ts) { Set<T> results = new HashSet<>(); Collections.addAll(results, ts); return results; }// w w w .j ava 2 s . c om }