public static RecordBuilder<Schema> record(String name) {
    return builder().record(name);
  }
@Test
  void recursiveRecord() {
    Schema schema = SchemaBuilder.record("LongList").fields().name("value").type().longType().noDefault().name("next")
        .type().optional().type("LongList").endRecord();

    assertEquals("LongList", schema.getName());
    List<Schema.Field> fields = schema.getFields();
    assertEquals(2, fields.size());
    assertEquals(new Schema.Field("value", Schema.create(Schema.Type.LONG), null), fields.get(0));

    assertEquals(Schema.Type.UNION, fields.get(1).schema().getType());

    assertEquals(Schema.Type.NULL, fields.get(1).schema().getTypes().get(0).getType());
    Schema recordSchema = fields.get(1).schema().getTypes().get(1);
    assertEquals(Schema.Type.RECORD, recordSchema.getType());
    assertEquals("LongList", recordSchema.getName());
    assertEquals(NullNode.getInstance(), fields.get(1).defaultValue());
  }