public static PsiType boxPrimitiveType(
      @Nullable PsiType result,
      @NotNull PsiManager manager,
      @NotNull GlobalSearchScope resolveScope,
      boolean boxVoid) {
    if (result instanceof PsiPrimitiveType && (boxVoid || result != PsiType.VOID)) {
      PsiPrimitiveType primitive = (PsiPrimitiveType) result;
      String boxedTypeName = primitive.getBoxedTypeName();
      if (boxedTypeName != null) {
        return GroovyPsiManager.getInstance(manager.getProject())
            .createTypeByFQClassName(boxedTypeName, resolveScope);
      }
    }

    return result;
  }
 @NotNull
 public static PsiClassType createTypeByFQClassName(
     @NotNull String fqName, @NotNull PsiElement context) {
   return GroovyPsiManager.getInstance(context.getProject())
       .createTypeByFQClassName(fqName, context.getResolveScope());
 }