PsiImportStaticStatement (PsiClass oldAssertClass, PsiReferenceExpression methodExpression) { final String referenceName = methodExpression.getReferenceName(); final PsiFile containingFile = methodExpression.getContainingFile(); if (!(containingFile instanceof PsiJavaFile)) { return null; } final PsiImportList importList = ((PsiJavaFile)containingFile).getImportList(); if (importList == null) { return null; } final PsiImportStaticStatement[] statements = importList.getImportStaticStatements(); for (PsiImportStaticStatement statement : statements) { if (oldAssertClass != statement.resolveTargetClass()) { continue; } final String importRefName = statement.getReferenceName(); final PsiJavaCodeReferenceElement importReference = statement.getImportReference(); if (importReference == null) { continue; } if (Comparing.strEqual(importRefName, referenceName)) { final PsiElement qualifier = importReference.getQualifier(); if (qualifier instanceof PsiJavaCodeReferenceElement) { return statement; } } else if (importRefName == null) { return statement; } } return null; }