GrImportStatement (@NotNull String qname, boolean isStatic, boolean isOnDemand, String alias, PsiElement context) { @NlsSafe StringBuilder builder = new StringBuilder(); builder.append("import "); if (isStatic) { builder.append("static "); } builder.append(qname); if (isOnDemand) { builder.append(".*"); } if (StringUtil.isNotEmpty(alias)) { builder.append(" as ").append(alias); } PsiFile dummyFile = createGroovyFileChecked(builder, false, context); return ((GrImportStatement)dummyFile.getFirstChild()); }