SetUtil { public static <E> Set<E> newHashSet() { return new HashSet<>(); }  static Set<E> newHashSet(); static Set<E> newHashSet(int initialCapacity); static Set<E> newHashSet(int initialCapacity, float loadFactor); static Set<E> newHashSet(Collection<? extends E> c); @SafeVarargs static Set<E> newHashSet(E... values); static boolean isEmpty(Set<?> set);  }
@Test public void testNewHashSet() { Set<Object> set1 = SetUtil.newHashSet(); assertEquals(set1.size(), 0); Set<String> set2 = SetUtil.newHashSet(1); assertEquals(set2.size(), 0); set2.add("1"); assertEquals(set2.size(), 1); Set<String> set3 = SetUtil.newHashSet("1", "2"); assertEquals(set3.size(), 2); }