Here you can find the source of newHashSetOnNull(Set
public static <T> Set<T> newHashSetOnNull(Set<T> set)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static <T> Set<T> newHashSetOnNull(Set<T> set) { if (set == null) { set = new HashSet<T>(); }//ww w . jav a 2 s . c om return set; } }