public static <T> PCollections<T> pCollections() {
    return new PCollections<>();
  }
@Test
  public void testIncompatibleWindowFnPropagationFailure() {
    p.enableAbandonedNodeEnforcement(false);

    PCollection<String> input1 =
        p.apply("CreateInput1", Create.of("Input1"))
            .apply("Window1", Window.into(FixedWindows.of(Duration.standardMinutes(1))));
    PCollection<String> input2 =
        p.apply("CreateInput2", Create.of("Input2"))
            .apply("Window2", Window.into(FixedWindows.of(Duration.standardMinutes(2))));

    try {
      PCollectionList.of(input1).and(input2).apply(Flatten.pCollections());
      Assert.fail("Exception should have been thrown");
    } catch (IllegalStateException e) {
      Assert.assertTrue(
          e.getMessage().startsWith("Inputs to Flatten had incompatible window windowFns"));
    }
  }