code: private void unbox(Expression expr, PrimitiveType primitiveType) {
      TypeElement boxedClass = findBoxedSuperclass(expr.getTypeMirror());
      if (primitiveType == null && boxedClass != null) {
        primitiveType = typeUtil.unboxedType(boxedClass.asType());
      }
      if (primitiveType == null) {
        return;
      }
      ExecutableElement valueMethod = ElementUtil.findMethod(
          boxedClass, TypeUtil.getName(primitiveType) + VALUE_METHOD);
      assert valueMethod != null : "could not find value method for " + boxedClass;
      MethodInvocation invocation = new MethodInvocation(new ExecutablePair(valueMethod), null);
      expr.replaceWith(invocation);
      invocation.setExpression(expr);
    }
docs: Convert a wrapper class instance to a specified primitive equivalent.