ImmutableMap<PCollection<?>, FieldAccessDescriptor> getPCollectionFieldAccess() {
    return ImmutableMap.copyOf(pCollectionFieldAccess);
  }
@Test
  public void testFieldAccessTwoKnownMainInputs() {
    Pipeline p = Pipeline.create();
    FieldAccessVisitor fieldAccessVisitor = new FieldAccessVisitor();
    Schema schema =
        Schema.of(
            Field.of("field1", FieldType.STRING),
            Field.of("field2", FieldType.STRING),
            Field.of("field3", FieldType.STRING));
    PCollection<Row> source =
        p.apply(Create.of(Row.withSchema(schema).addValues("foo", "bar", "baz").build()))
            .setRowSchema(schema);
    source.apply(new FieldAccessTransform(FieldAccessDescriptor.withFieldNames("field1")));
    source.apply(new FieldAccessTransform(FieldAccessDescriptor.withFieldNames("field2")));

    p.traverseTopologically(fieldAccessVisitor);

    FieldAccessDescriptor fieldAccess = fieldAccessVisitor.getPCollectionFieldAccess().get(source);
    assertFalse(fieldAccess.getAllFields());
    assertThat(fieldAccess.fieldNamesAccessed(), containsInAnyOrder("field1", "field2"));
  }