boolean (PsiClass testEngine, @NotNull PsiReference ref) { PsiProvidesStatement providesStatement = PsiTreeUtil.getParentOfType(ref.getElement(), PsiProvidesStatement.class); if (providesStatement != null) { PsiJavaCodeReferenceElement interfaceReference = providesStatement.getInterfaceReference(); PsiReferenceList implementationList = providesStatement.getImplementationList(); return interfaceReference != null && interfaceReference.isReferenceTo(testEngine) && implementationList != null && implementationList.getReferenceElements().length > 0; } return false; }