static boolean hasUnboundedOutput(Pipeline p) {
    PipelineTranslationModeOptimizer optimizer = new PipelineTranslationModeOptimizer();
    optimizer.translate(p);
    return optimizer.hasUnboundedCollections;
  }
@Test
  public void testBoundedCollectionProducingTransform() {
    PipelineOptions options = PipelineOptionsFactory.create();
    options.setRunner(FlinkRunner.class);
    Pipeline pipeline = Pipeline.create(options);
    pipeline.apply(GenerateSequence.from(0).to(10));

    assertThat(PipelineTranslationModeOptimizer.hasUnboundedOutput(pipeline), is(false));
  }