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