public static DynamicMessage messageFromGenericRecord(
      Descriptor descriptor,
      GenericRecord record,
      @Nullable String changeType,
      long changeSequenceNum) {
    return messageFromGenericRecord(
        descriptor, record, changeType, Long.toHexString(changeSequenceNum));
  }
@Test
  public void testMessageFromGenericRecord() throws Exception {
    Descriptors.Descriptor descriptor =
        TableRowToStorageApiProto.getDescriptorFromTableSchema(
            AvroGenericRecordToStorageApiProto.protoTableSchemaFromAvroSchema(NESTED_SCHEMA),
            true,
            false);
    DynamicMessage msg =
        AvroGenericRecordToStorageApiProto.messageFromGenericRecord(
            descriptor, nestedRecord, null, -1);

    assertEquals(2, msg.getAllFields().size());

    Map<String, Descriptors.FieldDescriptor> fieldDescriptors =
        descriptor.getFields().stream()
            .collect(Collectors.toMap(Descriptors.FieldDescriptor::getName, Functions.identity()));
    DynamicMessage nestedMsg = (DynamicMessage) msg.getField(fieldDescriptors.get("nested"));
    assertBaseRecord(nestedMsg, baseProtoExpectedFields);
  }