void (final @NotNull List<? extends PsiElement> elements, final @NotNull Collection<? super LineMarkerInfo<?>> result) { Set<PyFunction> functions = new HashSet<>(); for (PsiElement element : elements) { if (element instanceof PyClass) { collectInheritingClasses((PyClass)element, result); } else if (element instanceof PyFunction) { functions.add((PyFunction)element); } } collectOverridingMethods(functions, result); }