@Override
  public Map<PCollection<?>, ReplacementOutput> mapOutputs(
      Map<TupleTag<?>, PCollection<?>> outputs, PCollection<T> newOutput) {
    return ReplacementOutputs.singleton(outputs, newOutput);
  }
@Test
  public void outputMapping() {
    final PCollectionList<String> inputList =
        PCollectionList.of(first).and(second).and(first).and(first);
    PCollection<String> original = inputList.apply(Flatten.pCollections());
    PCollection<String> replacement = inputList.apply(new FlattenWithoutDuplicateInputs<>());

    assertThat(
        factory.mapOutputs(PValues.expandOutput(original), replacement),
        Matchers.hasEntry(
            replacement,
            ReplacementOutput.of(
                TaggedPValue.ofExpandedValue(original),
                TaggedPValue.ofExpandedValue(replacement))));
  }