JavaCodeFragment (TextWithImports item, PsiElement context, Project project) { GroovyCodeFragment result = new GroovyCodeFragment(project, item.getText()); result.setContext(context); return result; }