Sets { public static <T> PTransform<PCollection<T>, PCollection<T>> intersectDistinct( PCollection<T> rightCollection) { checkNotNull(rightCollection, "rightCollection argument is null"); return new SetImpl<>(rightCollection, intersectDistinct()); }  static PTransform<PCollection<T>, PCollection<T>> intersectDistinct(
      PCollection<T> rightCollection); static PTransform<PCollectionList<T>, PCollection<T>> intersectDistinct(); static PTransform<PCollection<T>, PCollection<T>> intersectAll(
      PCollection<T> rightCollection); static PTransform<PCollectionList<T>, PCollection<T>> intersectAll(); static PTransform<PCollection<T>, PCollection<T>> exceptDistinct(
      PCollection<T> rightCollection); static PTransform<PCollectionList<T>, PCollection<T>> exceptDistinct(); static PTransform<PCollection<T>, PCollection<T>> exceptAll(
      PCollection<T> rightCollection); static PTransform<PCollectionList<T>, PCollection<T>> exceptAll(); static PTransform<PCollection<T>, PCollection<T>> unionDistinct(
      PCollection<T> rightCollection); static PTransform<PCollectionList<T>, PCollection<T>> unionDistinct(); static PTransform<PCollection<T>, PCollection<T>> unionAll(
      PCollection<T> rightCollection); static Flatten.PCollections<T> unionAll();  }
@Test @Category(NeedsRunner.class) public void testIntersection() { PAssert.that(first.apply("strings", Sets.intersectDistinct(second))) .containsInAnyOrder("a", "b", "c", "d"); PCollection<Row> results = firstRows.apply("rows", Sets.intersectDistinct(secondRows)); PAssert.that(results).containsInAnyOrder(toRows("a", "b", "c", "d")); assertEquals(schema, results.getSchema()); p.run(); }
@Test @Category(NeedsRunner.class) public void testIntersectionCollectionList() { PCollection<String> third = p.apply("third", Create.of(Arrays.asList("b", "b", "c", "f"))); PCollection<Row> thirdRows = p.apply("thirdRows", Create.of(toRows("b", "b", "c", "f"))); PAssert.that( PCollectionList.of(first) .and(second) .and(third) .apply("stringsCols", Sets.intersectDistinct())) .containsInAnyOrder("b", "c"); PCollection<Row> results = PCollectionList.of(firstRows) .and(secondRows) .and(thirdRows) .apply("rowCols", Sets.intersectDistinct()); PAssert.that(results).containsInAnyOrder(toRows("b", "c")); assertEquals(schema, results.getSchema()); p.run(); }