private static @NonNls String toPrimitive(@NonNls String replaceByArg, PsiType from, PsiElement context) {
    if (PsiUtil.isLanguageLevel5OrHigher(context)) {
      return replaceByArg;
    }
    return from instanceof PsiPrimitiveType
           ? "((" + ((PsiPrimitiveType)from).getBoxedTypeName() + ")" + replaceByArg + ")." + from.getCanonicalText() + "Value()"
           : "((" + from.getCanonicalText() + ")" + replaceByArg + ")";
  }
private static @NonNls String toPrimitive(@NonNls String replaceByArg, PsiType from, PsiElement context)