Here you can find the source of createHashSet(T... arr)
public static <T> Set<T> createHashSet(T... arr)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static <T> Set<T> createHashSet(T... arr) { int size = arr == null ? 0 : arr.length; Set<T> set = new HashSet<T>(size); if (arr != null && arr.length > 0) { Collections.addAll(set, arr); }// w w w.j a va 2 s .c om return set; } }