@Override
  public PTransformReplacement<PCollectionList<T>, PCollection<T>> getReplacementTransform(
      AppliedPTransform<PCollectionList<T>, PCollection<T>, PCollections<T>> transform) {
    checkArgument(
        transform.getInputs().isEmpty(),
        "Unexpected nonempty input %s for %s",
        transform.getInputs(),
        getClass().getSimpleName());
    return PTransformReplacement.of(
        PCollectionList.empty(transform.getPipeline()), new CreateEmptyFromList<T>());
  }
@Test
  public void getInputEmptySucceeds() {
    PTransformReplacement<PCollectionList<Long>, PCollection<Long>> replacement =
        factory.getReplacementTransform(
            AppliedPTransform.of(
                "nonEmptyInput",
                Collections.emptyMap(),
                Collections.emptyMap(),
                Flatten.pCollections(),
                ResourceHints.create(),
                pipeline));
    assertThat(replacement.getInput().getAll(), emptyIterable());
  }