TSets { public static <T> Set<T> union(Set<T> a, Set<T> b) { Set<T> union = Sets.newLinkedHashSet(a); union.addAll(b); return union; }  static Set<T> intersection(Set<T> a, Set<T> b); static Set<Long> sequence(long from, long to); static Set<T> union(Set<T> a, Set<T> b);  }
@Test public void testUnion() { Set<Integer> a = Sets.newHashSet(); Set<Integer> b = Sets.newHashSet(); populate(a); populate(b); Assert.assertEquals(TSets.union(a, b), Sets.union(a, b).copyInto(Sets.<Integer> newHashSet())); }