docs: public static int computeElementSizeNoTag(final WireFormat.FieldType type, final Object value) {
          switch (type) {
              // Note: Minor violation of 80-char limit rule here because this would
              // actually be harder to read if we wrapped the lines.
              case DOUBLE:
                  return CodedOutputStream.computeDoubleSizeNoTag((Double) value);
              case FLOAT:
                  return CodedOutputStream.computeFloatSizeNoTag((Float) value);
              case INT64:
                  return CodedOutputStream.computeInt64SizeNoTag((Long) value);
              case UINT64:
                  return CodedOutputStream.computeUInt64SizeNoTag((Long) value);
              case INT32:
                  return CodedOutputStream.computeInt32SizeNoTag((Integer) value);
              case FIXED64:
                  return CodedOutputStream.computeFixed64SizeNoTag((Long) value);
              case FIXED32:
                  return CodedOutputStream.computeFixed32SizeNoTag((Integer) value);
              case BOOL:
                  return CodedOutputStream.computeBoolSizeNoTag((Boolean) value);
              case STRING:
                  return CodedOutputStream.computeStringSizeNoTag((String) value);
              case GROUP:
                  return CodedOutputStream.computeGroupSizeNoTag((MessageLite) value);
              case BYTES:
                  if (value instanceof ByteString) {
                      return CodedOutputStream.computeBytesSizeNoTag((ByteString) value);
                  } else {
                      return CodedOutputStream.computeByteArraySizeNoTag((byte[]) value);
                  }
              case UINT32:
                  return CodedOutputStream.computeUInt32SizeNoTag((Integer) value);
              case SFIXED32:
                  return CodedOutputStream.computeSFixed32SizeNoTag((Integer) value);
              case SFIXED64:
                  return CodedOutputStream.computeSFixed64SizeNoTag((Long) value);
              case SINT32:
                  return CodedOutputStream.computeSInt32SizeNoTag((Integer) value);
              case SINT64:
                  return CodedOutputStream.computeSInt64SizeNoTag((Long) value);
  
              case MESSAGE:
                  if (value instanceof LazyField) {
                      return CodedOutputStream.computeLazyFieldSizeNoTag((LazyField) value);
                  } else {
                      return computeObjectSizeNoTag(value);
                  }
  
              case ENUM:
                  if (value instanceof Internal.EnumLite) {
                      return CodedOutputStream.computeEnumSizeNoTag(((Internal.EnumLite) value).getNumber());
                  } else {
                      if (value instanceof EnumReadable) {
                          return CodedOutputStream.computeEnumSizeNoTag(((EnumReadable) value).value());
                      } else if (value instanceof Enum) {
                          return CodedOutputStream.computeEnumSizeNoTag(((Enum) value).ordinal());
                      }
  
                      return CodedOutputStream.computeEnumSizeNoTag((Integer) value);
                  }
          }
  
          throw new RuntimeException("There is no way to get here, but the compiler thinks otherwise.");
      }