code: public Object getRepeatedField(final FieldDescriptorType descriptor,
                                   final int index) {
      if (!descriptor.isRepeated()) {
        throw new IllegalArgumentException(
          "getRepeatedField() can only be called on repeated fields.");
      }
  
      final Object value = getField(descriptor);
  
      if (value == null) {
        throw new IndexOutOfBoundsException();
      } else {
        return ((List<?>) value).get(index);
      }
    }
docs: Useful for implementing
  {@link Message#getRepeatedField(Descriptors.FieldDescriptor,int)}.