code: public Expression unboxAsMessage() {
      if (soyType().getKind() == Kind.NULL) {
        // If this is a null literal, return a Messaged-typed null literal.
        return BytecodeUtils.constantNull(BytecodeUtils.MESSAGE_TYPE);
      }
      // Attempting to unbox an unboxed proto
      // (We compare the non-nullable type because being null doesn't impact unboxability,
      //  and if we didn't remove null then isKnownProtoOrUnionOfProtos would fail.)
      if (soyRuntimeType.asNonNullable().isKnownProtoOrUnionOfProtos() && !isBoxed()) {
        return this;
      }
      if (delegate.isNonNullable()) {
        return delegate.invoke(MethodRef.SOY_PROTO_VALUE_GET_PROTO);
      }
  
      return new Expression(BytecodeUtils.MESSAGE_TYPE, features()) {
        @Override
        protected void doGen(CodeBuilder adapter) {
          Label end = new Label();
          delegate.gen(adapter);
          BytecodeUtils.nullCoalesce(adapter, end);
          MethodRef.SOY_PROTO_VALUE_GET_PROTO.invokeUnchecked(adapter);
          adapter.mark(end);
        }
      };
    }
docs: Unboxes this to a {@link SoyExpression} with a Message runtime type.
  
  <p>This method is appropriate when you know (likely via inspection of the {@link #soyType()},
  or other means) that the value does have the appropriate type but you prefer to interact with
  it as its unboxed representation.