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