void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiElement elementToRemove = myElementFunction.fun(element); if (elementToRemove == null) return; elementToRemove.delete(); }