public static Collection<PValue> nonAdditionalInputs(AppliedPTransform<?, ?, ?> application) {
    ImmutableList.Builder<PValue> mainInputs = ImmutableList.builder();
    PTransform<?, ?> transform = application.getTransform();
    for (Map.Entry<TupleTag<?>, PCollection<?>> input : application.getInputs().entrySet()) {
      if (!transform.getAdditionalInputs().containsKey(input.getKey())) {
        mainInputs.add(input.getValue());
      }
    }
    checkArgument(
        !mainInputs.build().isEmpty() || application.getInputs().isEmpty(),
        "Expected at least one main input if any inputs exist");
    return mainInputs.build();
  }
@Test
  public void nonAdditionalInputsWithMultipleNonAdditionalInputsSucceeds() {
    Map<TupleTag<?>, PCollection<?>> allInputs = new HashMap<>();
    PCollection<Integer> mainInts = pipeline.apply("MainInput", Create.of(12, 3));
    allInputs.put(new TupleTag<Integer>() {}, mainInts);
    PCollection<Void> voids = pipeline.apply("VoidInput", Create.empty(VoidCoder.of()));
    allInputs.put(new TupleTag<Void>() {}, voids);
    AppliedPTransform<PInput, POutput, TestTransform> transform =
        AppliedPTransform.of(
            "additional-free",
            allInputs,
            Collections.emptyMap(),
            new TestTransform(),
            ResourceHints.create(),
            pipeline);

    assertThat(
        TransformInputs.nonAdditionalInputs(transform),
        Matchers.containsInAnyOrder(voids, mainInts));
  }