PsiElement (@NotNull PsiElement element, @NotNull Function<? super PsiElement, ? extends PsiElement> processor) { for (GeneratedSourcesFilter filter : GeneratedSourcesFilter.EP_NAME.getExtensionList()) { for (PsiElement originalElement: filter.getOriginalElements(element)) { PsiElement apply = processor.apply(originalElement); if (apply != null) return apply; } } return null; }