boolean (final PsiElement element, final PsiClass aClass) { if (element.getContainingFile() instanceof PsiJavaFile) { final PsiImportList importList = ((PsiJavaFile)element.getContainingFile()).getImportList(); if (importList != null) { final PsiImportStaticStatement[] importStaticStatements = importList.getImportStaticStatements(); return ContainerUtil.exists(importStaticStatements, stmt -> stmt.isOnDemand() && stmt.resolveTargetClass() == aClass); } } return false; }