docs: @SuppressWarnings("unchecked")
      static <T> T parseField(CodedInputStream input, ExtensionRegistryLite extensionRegistry, WireFormat.FieldType type,
              T value) throws IOException {
          switch (type) {
              case MESSAGE:
                  int length = input.readRawVarint32();
                  final int oldLimit = input.pushLimit(length);
                  Codec<? extends Object> codec = ProtobufProxy.create(value.getClass());
                  T ret = (T) codec.decode(input.readRawBytes(length));
                  input.popLimit(oldLimit);
                  return ret;
              case ENUM:
                  return (T) (java.lang.Integer) input.readEnum();
              case GROUP:
                  throw new RuntimeException("Groups are not allowed in maps.");
              default:
                  return (T) CodedConstant.readPrimitiveField(input, type, true);
          }
      }