public static <T> Inner<T> create() {
    return new Inner<>();
  }
@Test
  @Category(NeedsRunner.class)
  public void renameNestedInArrayFields() {
    Schema nestedSchema = Schema.builder().addStringField("field1").addInt32Field("field2").build();
    Schema schema =
        Schema.builder().addArrayField("array", Schema.FieldType.row(nestedSchema)).build();

    PCollection<Row> renamed =
        pipeline
            .apply(
                Create.of(
                        Row.withSchema(schema)
                            .addValue(
                                ImmutableList.of(
                                    Row.withSchema(nestedSchema).addValues("one", 1).build()))
                            .build(),
                        Row.withSchema(schema)
                            .addValue(
                                ImmutableList.of(
                                    Row.withSchema(nestedSchema).addValues("two", 1).build()))
                            .build())
                    .withRowSchema(schema))
            .apply(
                RenameFields.<Row>create()
                    .rename("array.field1", "new1")
                    .rename("array.field2", "new2"));

    Schema expectedNestedSchema =
        Schema.builder().addStringField("new1").addInt32Field("new2").build();
    Schema expectedSchema =
        Schema.builder().addArrayField("array", Schema.FieldType.row(expectedNestedSchema)).build();
    assertEquals(expectedSchema, renamed.getSchema());

    List<Row> expectedRows =
        ImmutableList.of(
            Row.withSchema(expectedSchema)
                .addValue(
                    ImmutableList.of(
                        Row.withSchema(expectedNestedSchema).addValues("one", 1).build()))
                .build(),
            Row.withSchema(expectedSchema)
                .addValue(
                    ImmutableList.of(
                        Row.withSchema(expectedNestedSchema).addValues("two", 1).build()))
                .build());

    PAssert.that(renamed).containsInAnyOrder(expectedRows);
    pipeline.run();
  }