code: public static Descriptor getProtobufDescriptor(Class<? extends Message> protoClass) {
      try {
        return (Descriptor) protoClass.getMethod("getDescriptor").invoke(null);
      } catch (Exception e) {
        throw new RuntimeException(String.format("Failed to get Descriptor for Message type '%s'", protoClass.getName()), e);
      }
    }
docs: Invokes the static {@code getDescriptor} method of the given {@link Message} class.
  
  @param protoClass the {@link Message} class whose {@link Descriptor} should be retrieved.
  @return the Descriptor instance for the given {@link Message} class.
  @throws RuntimeException on any exception encountered during introspection of protoClass or
  invocation of its static {@code getDescriptor} method.
  @see Descriptors