code: @SuppressWarnings("unchecked")
    public void addRepeatedField(final FieldDescriptorType descriptor,
                                 final Object value) {
      if (!descriptor.isRepeated()) {
        throw new IllegalArgumentException(
          "addRepeatedField() can only be called on repeated fields.");
      }
  
      verifyType(descriptor.getLiteType(), value);
  
      final Object existingValue = getField(descriptor);
      List<Object> list;
      if (existingValue == null) {
        list = new ArrayList<Object>();
        fields.put(descriptor, list);
      } else {
        list = (List<Object>) existingValue;
      }
  
      list.add(value);
    }
docs: Useful for implementing
  {@link Message.Builder#addRepeatedField(Descriptors.FieldDescriptor,Object)}.