void (PsiElement element) { if (element instanceof PsiJavaToken keyword) { final IElementType tokenType = keyword.getTokenType(); if (tokenType.equals(JavaTokenType.FINALLY_KEYWORD)) { keyword.delete(); return; } } deleteUntilFinally(element.getPrevSibling()); if (!(element instanceof PsiWhiteSpace)) { element.delete(); } }