code: public static int computeElementSize(final WireFormat.FieldType type, final int number, final Object value) {
          int tagSize = CodedOutputStream.computeTagSize(number);
          if (type == WireFormat.FieldType.GROUP) {
              // Only count the end group tag for proto2 messages as for proto1 the end
              // group tag will be counted as a part of getSerializedSize().
              tagSize *= 2;
          }
          return tagSize + computeElementSizeNoTag(type, value);
      }
docs: Compute the number of bytes that would be needed to encode a single tag/value pair of arbitrary type.
  
  @param type The field's type.
  @param number The field's number.
  @param value Object representing the field's value. Must be of the exact type which would be returned by
  {@link Message#getField(Descriptors.FieldDescriptor)} for this field.
  @return the int