String (@NotNull PsiClass aClass) { PsiElementProcessor.CollectElementsWithLimit<PsiClass> processor = getProcessor(5, true); ClassInheritorsSearch.search(aClass).forEach(new PsiElementProcessorAdapter<>(processor)); if (processor.isOverflow()) { return getImplementationTooltip(aClass.isInterface() ? "tooltip.is.implemented.by.several.subclasses" : "tooltip.is.overridden.by.several.subclasses"); } PsiClass[] subclasses = processor.toArray(PsiClass.EMPTY_ARRAY); if (subclasses.length == 0) return getFunctionalImplementationTooltip(aClass); Comparator<PsiClass> comparator = PsiElementRenderingInfo.getComparator(PsiClassRenderingInfo.INSTANCE); Arrays.sort(subclasses, comparator); return getImplementationTooltip(aClass.isInterface() ? "tooltip.is.implemented.by" : "tooltip.is.subclassed.by", subclasses); }