ThriftToDynamicProto { public Descriptors.FileDescriptor getFileDescriptor() { return fileDescriptor; } ThriftToDynamicProto(Class<T> thriftClass);  ThriftToDynamicProto(Class<T> thriftClass,
                              boolean supportNestedObjects,
                              boolean ignoreUnsupportedTypes);  ThriftToDynamicProto(Class<T> thriftClass, List<Pair<String, Type>> extraFields);  ThriftToDynamicProto(Class<T> thriftClass,
                              List<Pair<String, Type>> extraFields,
                              boolean supportNestedObjects,
                              boolean ignoreUnsupportedTypes); Message.Builder getBuilder(Class<? extends TBase<?, ?>> thriftClass); @SuppressWarnings("unchecked") Message convert(T thriftObj); @SuppressWarnings("unchecked") Message doConvert(TBase<?, F> thriftObj); FieldDescriptor getFieldDescriptor(Class<? extends TBase<?, ?>> thriftClass,
                                            String fieldName); Descriptors.FileDescriptor getFileDescriptor();  }
@Test public void testGetFileDescriptor() throws DescriptorValidationException { ThriftToDynamicProto<Person> converter = new ThriftToDynamicProto<Person>(Person.class); Person person = genPerson(); Message msg = converter.convert(person); FileDescriptor expectedFd = msg.getDescriptorForType().getFile(); FileDescriptor actualFd = converter.getFileDescriptor(); assertEquals(expectedFd, actualFd); }