code: public static <T> Set<T> arrayToSet(final T[] array) {
          if (null == array) {
              return Collections.emptySet();
          }
  
          final Set<T> ret = new HashSet<T>();
  
          for (int i = 0; i < array.length; i++) {
              final T object = array[i];
  
              ret.add(object);
          }
  
          return ret;
      }
docs: Converts the specified array to a set.
  
  @param <T>   the type of elements maintained by the specified array
  @param array the specified array
  @return a hash set