Record convert(Object data) {
    return convert(data, null);
  }
@Test
  public void testEvolveTypeDetectionStruct() {
    org.apache.iceberg.Schema tableSchema =
        new org.apache.iceberg.Schema(
            NestedField.required(1, "ii", IntegerType.get()),
            NestedField.required(2, "ff", FloatType.get()));

    Table table = mock(Table.class);
    when(table.schema()).thenReturn(tableSchema);
    RecordConverter converter = new RecordConverter(table, config);

    Schema valueSchema =
        SchemaBuilder.struct().field("ii", Schema.INT64_SCHEMA).field("ff", Schema.FLOAT64_SCHEMA);
    Struct data = new Struct(valueSchema).put("ii", 11L).put("ff", 22d);

    SchemaUpdate.Consumer consumer = new SchemaUpdate.Consumer();
    converter.convert(data, consumer);
    Collection<UpdateType> updates = consumer.updateTypes();

    assertThat(updates).hasSize(2);

    Map<String, UpdateType> updateMap = Maps.newHashMap();
    updates.forEach(update -> updateMap.put(update.name(), update));

    assertThat(updateMap.get("ii").type()).isInstanceOf(LongType.class);
    assertThat(updateMap.get("ff").type()).isInstanceOf(DoubleType.class);
  }