ImmutableMap<PCollection<?>, FieldAccessDescriptor> getPCollectionFieldAccess() {
    return ImmutableMap.copyOf(pCollectionFieldAccess);
  }
@Test
  public void testFieldAccessKnownMainAndUnknownSideInputs() {
    Pipeline p = Pipeline.create();
    FieldAccessVisitor fieldAccessVisitor = new FieldAccessVisitor();
    Schema schema =
        Schema.of(Field.of("field1", FieldType.STRING), Field.of("field2", FieldType.STRING));

    PCollection<Row> source1 =
        p.apply(Create.of(Row.withSchema(schema).addValues("foo", "bar").build()))
            .setRowSchema(schema);
    source1.apply(new FieldAccessTransform(FieldAccessDescriptor.withFieldNames("field1")));
    PCollectionView<Row> source1View = source1.apply(View.asSingleton());
    PCollection<Row> source2 =
        p.apply(Create.of(Row.withSchema(schema).addValues("baz", "qux").build()))
            .setRowSchema(schema);
    source2
        .apply(ParDo.of(new UnknownDoFn()).withSideInput("source1View", source1View))
        .setRowSchema(schema);

    p.traverseTopologically(fieldAccessVisitor);

    assertTrue(fieldAccessVisitor.getPCollectionFieldAccess().get(source1).getAllFields());
    assertTrue(fieldAccessVisitor.getPCollectionFieldAccess().get(source2).getAllFields());
  }