Comparable (@NotNull final PsiElement element, @NotNull final ProximityLocation location) { if (location.getPosition() == null || !(element instanceof PsiClass)) { return null; } if (isTooGeneral((PsiClass)element)) return false; Set<String> superClasses = PLACE_SUPER_CLASSES.getValue(location); if (superClasses.isEmpty()) { return false; } final PsiElement position = location.getPosition(); PsiClass placeClass = findPlaceClass(element, position); if (placeClass == null) return false; PsiClass elementClass = placeClass; while (elementClass != null) { if (superClasses.contains(elementClass.getQualifiedName())) { return true; } elementClass = elementClass.getContainingClass(); } return false; }