void (@NotNull final Supplier<? extends PsiElement> element, @NotNull final TokenSet types) { while (element.get() != null && types.contains(PsiUtilCore.getElementType(element.get()))) { element.get().delete(); } }