public static Map<PCollection<?>, ReplacementOutput> singleton(
      Map<TupleTag<?>, PCollection<?>> original, POutput replacement) {
    Entry<TupleTag<?>, PCollection<?>> originalElement =
        Iterables.getOnlyElement(original.entrySet());
    Entry<TupleTag<?>, PCollection<?>> replacementElement =
        Iterables.getOnlyElement(PValues.expandOutput(replacement).entrySet());
    return Collections.singletonMap(
        replacementElement.getValue(),
        ReplacementOutput.of(
            TaggedPValue.of(originalElement.getKey(), originalElement.getValue()),
            TaggedPValue.of(replacementElement.getKey(), replacementElement.getValue())));
  }
@Test
  public void singletonSucceeds() {
    Map<PCollection<?>, ReplacementOutput> replacements =
        ReplacementOutputs.singleton(PValues.expandValue(ints), replacementInts);

    assertThat(replacements, Matchers.hasKey(replacementInts));

    ReplacementOutput replacement = replacements.get(replacementInts);
    Map.Entry<TupleTag<?>, PValue> taggedInts = Iterables.getOnlyElement(ints.expand().entrySet());
    assertThat(replacement.getOriginal().getTag(), equalTo(taggedInts.getKey()));
    assertThat(replacement.getOriginal().getValue(), equalTo(taggedInts.getValue()));
    assertThat(replacement.getReplacement().getValue(), equalTo(replacementInts));
  }