boolean (final PsiElement element, final PsiClass aClass) { if (element.getContainingFile() instanceof GroovyFile) { final GrImportStatement[] importStatements = ((GroovyFile)element.getContainingFile()).getImportStatements(); for (GrImportStatement stmt : importStatements) { final GrCodeReferenceElement ref = stmt.getImportReference(); if (ref != null && stmt.isStatic() && stmt.isOnDemand() && ref.resolve() == aClass) { return true; } } } return false; }