List of utility methods to do Set Create
Set | CreateHashSet(T[] array) Create Hash Set Set<T> set = new HashSet<T>(); for (T v : array) { set.add(v); return set; |
Set | CreateSortedSet(T[] array) Create Sorted Set Set<T> set = new TreeSet<T>(); for (T v : array) { set.add(v); return set; |
HashSet | asSet(E... es) Return the hash set consisting of adding the specified argument to a newly constructed set. HashSet<E> result = new HashSet<E>(); for (E e : es) result.add(e); return result; |