PsiJavaCodeReferenceElement (@NotNull PsiClass aClass) { PsiImportList importList = getImportList(); if (importList != null) { PsiImportStatement[] statements = importList.getImportStatements(); for (PsiImportStatement statement : statements) { if (!statement.isOnDemand()) { PsiElement ref = statement.resolve(); if (ref != null && getManager().areElementsEquivalent(ref, aClass)) { return statement.getImportReference(); } } } } return null; }