public static SerializableFunction<byte[], Row> getProtoBytesToRowFromSchemaFunction(
      String schemaString, String messageName) {

    Descriptors.Descriptor descriptor = getDescriptorFromProtoSchema(schemaString, messageName);

    ProtoDynamicMessageSchema<DynamicMessage> protoDynamicMessageSchema =
        ProtoDynamicMessageSchema.forDescriptor(ProtoDomain.buildFrom(descriptor), descriptor);
    return new SimpleFunction<byte[], Row>() {
      @Override
      public Row apply(byte[] input) {
        try {
          Descriptors.Descriptor descriptorFunction =
              getDescriptorFromProtoSchema(schemaString, messageName);
          DynamicMessage dynamicMessage = DynamicMessage.parseFrom(descriptorFunction, input);
          SerializableFunction<DynamicMessage, Row> res =
              protoDynamicMessageSchema.getToRowFunction();
          return res.apply(dynamicMessage);
        } catch (InvalidProtocolBufferException e) {
          LOG.error("Error parsing to DynamicMessage", e);
          throw new RuntimeException(e);
        }
      }
    };
  }
@Test
  public void testProtoBytesToRowSchemaStringGenerateSerializableFunction() {
    SerializableFunction<byte[], Row> protoBytesToRowFunction =
        ProtoByteUtils.getProtoBytesToRowFromSchemaFunction(PROTO_STRING_SCHEMA, "MyMessage");
    Assert.assertNotNull(protoBytesToRowFunction);
  }