Code review comment: done (I can refactor tests to share pairs of inputs later, but anyhow I added the reverse tests)

Code under review:
public static Row recordToRow(Schema schema, Record record) {
    Row.Builder rowBuilder = Row.withSchema(schema);
    for (Schema.Field field : schema.getFields()) {
      switch (field.getType().getTypeName()) {
        case BYTE:
          
          byte byteValue = (byte) record.getField(field.getName());
          rowBuilder.addValue(byteValue);
          break;
        case INT16:
          
          short shortValue = (short) record.getField(field.getName());
          rowBuilder.addValue(shortValue);
          break;
        case INT32:
          
          int intValue = (int) record.getField(field.getName());
          rowBuilder.addValue(intValue);
          break;
        case INT64:
          
          long longValue = (long) record.getField(field.getName());
          rowBuilder.addValue(longValue);
          break;
        case DECIMAL:
          
          rowBuilder.addValue(record.getField(field.getName()));
          break;
        case FLOAT:
          
          rowBuilder.addValue(record.getField(field.getName()));
          break;
        case DOUBLE:
          
          rowBuilder.addValue(record.getField(field.getName()));
          break;
        case STRING:
          
          rowBuilder.addValue(record.getField(field.getName()));
          break;
        case DATETIME:
          
          long millis = (long) record.getField(field.getName());
          rowBuilder.addValue(new DateTime(millis, DateTimeZone.UTC));
          break;
        case BOOLEAN:
          
          rowBuilder.addValue(record.getField(field.getName()));
          break;
        case BYTES:
          
          rowBuilder.addValue(((ByteBuffer) record.getField(field.getName())).array());
          break;
        case ARRAY:
          throw new UnsupportedOperationException("Array fields are not yet supported.");
        case ITERABLE:
          throw new UnsupportedOperationException("Iterable fields are not yet supported.");
        case MAP:
          throw new UnsupportedOperationException("Map fields are not yet supported.");
        case ROW:
          Record nestedRecord = (Record) record.getField(field.getName());
          Schema nestedSchema =
              checkArgumentNotNull(
                  field.getType().getRowSchema(),
                  "Corrupted schema: Row type did not have associated nested schema.");
          Row nestedRow = recordToRow(nestedSchema, nestedRecord);
          rowBuilder.addValue(nestedRow);
          break;
        case LOGICAL_TYPE:
          throw new UnsupportedOperationException(
              "Cannot convert iceberg field to Beam logical type");
      }
    }
    return rowBuilder.build();
  }


Revised code:
public static Row recordToRow(Schema schema, Record record) {
    Row.Builder rowBuilder = Row.withSchema(schema);
    for (Schema.Field field : schema.getFields()) {
      switch (field.getType().getTypeName()) {
        case BYTE:
          
          byte byteValue = (byte) record.getField(field.getName());
          rowBuilder.addValue(byteValue);
          break;
        case INT16:
          
          short shortValue = (short) record.getField(field.getName());
          rowBuilder.addValue(shortValue);
          break;
        case INT32:
          
          int intValue = (int) record.getField(field.getName());
          rowBuilder.addValue(intValue);
          break;
        case INT64:
          
          long longValue = (long) record.getField(field.getName());
          rowBuilder.addValue(longValue);
          break;
        case DECIMAL:
          
          rowBuilder.addValue(record.getField(field.getName()));
          break;
        case FLOAT:
          
          rowBuilder.addValue(record.getField(field.getName()));
          break;
        case DOUBLE:
          
          rowBuilder.addValue(record.getField(field.getName()));
          break;
        case STRING:
          
          rowBuilder.addValue(record.getField(field.getName()));
          break;
        case DATETIME:
          
          long millis = (long) record.getField(field.getName());
          rowBuilder.addValue(new DateTime(millis, DateTimeZone.UTC));
          break;
        case BOOLEAN:
          
          rowBuilder.addValue(record.getField(field.getName()));
          break;
        case BYTES:
          
          rowBuilder.addValue(((ByteBuffer) record.getField(field.getName())).array());
          break;
        case ARRAY:
          throw new UnsupportedOperationException("Array fields are not yet supported.");
        case ITERABLE:
          throw new UnsupportedOperationException("Iterable fields are not yet supported.");
        case MAP:
          throw new UnsupportedOperationException("Map fields are not yet supported.");
        case ROW:
          Record nestedRecord = (Record) record.getField(field.getName());
          Schema nestedSchema =
              checkArgumentNotNull(
                  field.getType().getRowSchema(),
                  "Corrupted schema: Row type did not have associated nested schema.");
          Row nestedRow = recordToRow(nestedSchema, nestedRecord);
          rowBuilder.addValue(nestedRow);
          break;
        case LOGICAL_TYPE:
          throw new UnsupportedOperationException(
              "Cannot convert iceberg field to Beam logical type");
      }
    }
    return rowBuilder.build();
  }