@VisibleForTesting
  Schema convertSchema(org.apache.avro.Schema schema) {
    return Schema.of(getFields(schema));
  }
@Test
  void convertSchemaListOfNullableRecords() {
    Schema nestedRecordType = SchemaBuilder.record("nested_record").fields().optionalString("inner_string_field").endRecord();
    Schema input = SchemaBuilder.record("top_level_schema")
        .fields().name("top_level_schema_field")
        .type()
        .nullable()
        .array()
        .items(SchemaBuilder.unionOf().nullType().and().type(nestedRecordType).endUnion())
        .noDefault()
        .endRecord();

    Field innerStringField = Field.newBuilder("inner_string_field", StandardSQLTypeName.STRING)
        .setMode(Field.Mode.NULLABLE)
        .build();
    Field topLevelSchemaField = Field.newBuilder("top_level_schema_field", StandardSQLTypeName.STRUCT,
        innerStringField).setMode(Field.Mode.REPEATED).build();

    com.google.cloud.bigquery.Schema expected = com.google.cloud.bigquery.Schema.of(topLevelSchemaField);
    Assertions.assertEquals(expected, SCHEMA_RESOLVER.convertSchema(input));
  }