Java HashSet Create newHashSetOnNull(Set set)

Here you can find the source of newHashSetOnNull(Set set)

Description

new Hash Set On Null

License

Apache License

Declaration

public static <T> Set<T> newHashSetOnNull(Set<T> set) 

Method Source Code


//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;
    }
}

Related

  1. isValidTagException(HashSet tagExceptions, String buffer)
  2. newHashSet(boolean optimized, T... array)
  3. newHashSet(E... elements)
  4. newHashSet(E... elements)
  5. newHashSet(E... elements)
  6. print_bigrams(HashSet bigrams)
  7. printlnStringHashSet(HashSet hashSet)
  8. select(HashSet S)
  9. stringArrayToHashset(String[] strings)