code: public boolean hasField(final FieldDescriptorType descriptor) {
      if (descriptor.isRepeated()) {
        throw new IllegalArgumentException(
          "hasField() can only be called on non-repeated fields.");
      }
  
      return fields.get(descriptor) != null;
    }
docs: Useful for implementing
  {@link Message#hasField(Descriptors.FieldDescriptor)}.