code: public void add(final FieldDescriptor type, final Message defaultInstance) {
      if (type.getJavaType() != FieldDescriptor.JavaType.MESSAGE) {
        throw new IllegalArgumentException(
          "ExtensionRegistry.add() provided a default instance for a " +
          "non-message extension.");
      }
      add(new ExtensionInfo(type, defaultInstance));
    }
docs: Add a message-type extension to the registry by descriptor.