Integer (@NotNull PsiElement element, @NotNull ProximityLocation location, @NotNull Project project) { if (element instanceof PsiClass) { final String qualifiedName = ((PsiClass)element).getQualifiedName(); if (qualifiedName != null) { if (qualifiedName.startsWith("org.testng.internal")) { return -1; } VirtualFile locationFile = PsiUtilCore.getVirtualFile(location.getPosition()); if (locationFile != null && ProjectFileIndex.getInstance(project).isInTestSourceContent(locationFile) && (qualifiedName.contains("junit") || qualifiedName.contains("test"))) { return 1; } } } return null; }