public static <T> PCollections<T> pCollections() {
    return new PCollections<>();
  }
@Test
  @Category(ValidatesRunner.class)
  public void testFlattenMultiplePCollectionsHavingMultipleConsumers() {
    PCollection<String> input = p.apply(Create.of("AA", "BBB", "CC"));
    final TupleTag<String> outputEvenLengthTag = new TupleTag<String>() {};
    final TupleTag<String> outputOddLengthTag = new TupleTag<String>() {};

    PCollectionTuple tuple =
        input.apply(
            ParDo.of(
                    new DoFn<String, String>() {
                      @ProcessElement
                      public void processElement(ProcessContext c) {
                        if (c.element().length() % 2 == 0) {
                          c.output(c.element());
                        } else {
                          c.output(outputOddLengthTag, c.element());
                        }
                      }
                    })
                .withOutputTags(outputEvenLengthTag, TupleTagList.of(outputOddLengthTag)));

    PCollection<String> outputEvenLength = tuple.get(outputEvenLengthTag);
    PCollection<String> outputOddLength = tuple.get(outputOddLengthTag);

    PCollection<String> outputMerged =
        PCollectionList.of(outputEvenLength).and(outputOddLength).apply(Flatten.pCollections());

    PAssert.that(outputMerged).containsInAnyOrder("AA", "BBB", "CC");
    PAssert.that(outputEvenLength).containsInAnyOrder("AA", "CC");
    PAssert.that(outputOddLength).containsInAnyOrder("BBB");

    p.run();
  }