### Question:
ArrowSchemaUtil { public static Schema convert(final org.apache.iceberg.Schema schema) { ImmutableList.Builder<Field> fields = ImmutableList.builder(); for (NestedField f : schema.columns()) { fields.add(convert(f)); } return new Schema(fields.build()); } private  ArrowSchemaUtil(); static Schema convert(final org.apache.iceberg.Schema schema); static Field convert(final NestedField field);  }### Answer:
@Test public void convertPrimitive() { Schema iceberg = new Schema( Types.NestedField.optional(0, INTEGER_FIELD, IntegerType.get()), Types.NestedField.optional(1, BOOLEAN_FIELD, BooleanType.get()), Types.NestedField.required(2, DOUBLE_FIELD, DoubleType.get()), Types.NestedField.required(3, STRING_FIELD, StringType.get()), Types.NestedField.optional(4, DATE_FIELD, DateType.get()), Types.NestedField.optional(5, TIMESTAMP_FIELD, TimestampType.withZone()), Types.NestedField.optional(6, LONG_FIELD, LongType.get()), Types.NestedField.optional(7, FLOAT_FIELD, FloatType.get()), Types.NestedField.optional(8, TIME_FIELD, TimeType.get()), Types.NestedField.optional(9, BINARY_FIELD, Types.BinaryType.get()), Types.NestedField.optional(10, DECIMAL_FIELD, Types.DecimalType.of(1, 1)), Types.NestedField.optional(12, LIST_FIELD, Types.ListType.ofOptional(13, Types.IntegerType.get())), Types.NestedField.required(14, MAP_FIELD, Types.MapType.ofOptional(15, 16, StringType.get(), IntegerType.get())), Types.NestedField.optional(17, FIXED_WIDTH_BINARY_FIELD, Types.FixedType.ofLength(10))); org.apache.arrow.vector.types.pojo.Schema arrow = ArrowSchemaUtil.convert(iceberg); validate(iceberg, arrow); }
@Test public void convertComplex() { Schema iceberg = new Schema( Types.NestedField.optional(0, "m", MapType.ofOptional( 1, 2, StringType.get(), LongType.get()) ), Types.NestedField.required(3, "m2", MapType.ofOptional( 4, 5, StringType.get(), ListType.ofOptional(6, TimestampType.withoutZone())) ) ); org.apache.arrow.vector.types.pojo.Schema arrow = ArrowSchemaUtil.convert(iceberg); Assert.assertEquals(iceberg.columns().size(), arrow.getFields().size()); }