public static Builder withSchema(Schema schema) {
    return new Builder(schema);
  }
@Test
  public void testCreateWithNames() {
    Schema type =
        Stream.of(
                Schema.Field.of("f_str", FieldType.STRING),
                Schema.Field.of("f_byte", FieldType.BYTE),
                Schema.Field.of("f_short", FieldType.INT16),
                Schema.Field.of("f_int", FieldType.INT32),
                Schema.Field.of("f_long", FieldType.INT64),
                Schema.Field.of("f_float", FieldType.FLOAT),
                Schema.Field.of("f_double", FieldType.DOUBLE),
                Schema.Field.of("f_decimal", FieldType.DECIMAL),
                Schema.Field.of("f_boolean", FieldType.BOOLEAN),
                Schema.Field.of("f_datetime", FieldType.DATETIME),
                Schema.Field.of("f_bytes", FieldType.BYTES),
                Schema.Field.of("f_array", FieldType.array(FieldType.STRING)),
                Schema.Field.of("f_iterable", FieldType.iterable(FieldType.STRING)),
                Schema.Field.of("f_map", FieldType.map(FieldType.STRING, FieldType.STRING)))
            .collect(toSchema());

    DateTime dateTime =
        new DateTime().withDate(1979, 03, 14).withTime(1, 2, 3, 4).withZone(DateTimeZone.UTC);
    byte[] bytes = new byte[] {1, 2, 3, 4};

    Row row =
        Row.withSchema(type)
            .withFieldValue("f_str", "str1")
            .withFieldValue("f_byte", (byte) 42)
            .withFieldValue("f_short", (short) 43)
            .withFieldValue("f_int", (int) 44)
            .withFieldValue("f_long", (long) 45)
            .withFieldValue("f_float", (float) 3.14)
            .withFieldValue("f_double", (double) 3.141)
            .withFieldValue("f_decimal", new BigDecimal("3.1415"))
            .withFieldValue("f_boolean", true)
            .withFieldValue("f_datetime", dateTime)
            .withFieldValue("f_bytes", bytes)
            .withFieldValue("f_array", Lists.newArrayList("one", "two"))
            .withFieldValue("f_iterable", Lists.newArrayList("one", "two", "three"))
            .withFieldValue("f_map", ImmutableMap.of("hello", "goodbye", "here", "there"))
            .build();

    Row expectedRow =
        Row.withSchema(type)
            .addValues(
                "str1",
                (byte) 42,
                (short) 43,
                (int) 44,
                (long) 45,
                (float) 3.14,
                (double) 3.141,
                new BigDecimal("3.1415"),
                true,
                dateTime,
                bytes,
                Lists.newArrayList("one", "two"),
                Lists.newArrayList("one", "two", "three"),
                ImmutableMap.of("hello", "goodbye", "here", "there"))
            .build();
    assertEquals(expectedRow, row);
  }