public static <T>Set<T> asSet(T... values){
  if (values == null) {
    return new HashSet<T>(0);
  }
 else {
    return new HashSet<T>(Arrays.asList(values));
  }
}

public static < T > Set < T > asSet ( T ... values ) { if ( values == null ) { return new HashSet < T > ( 0 ) ; } else { return new HashSet < T > ( Arrays . asList ( values ) ) ; } }
collects the passed in objects into an unordered set .
