void () { myFixture.enableInspections(new CheckTagEmptyBodyInspection()); PsiFile file = myFixture.configureByText(XmlFileType.INSTANCE, """ <a> <b><caret></b> </a>"""); assertTrue(new CollapseTagIntention().isAvailable(getProject(), myFixture.getEditor(), file)); IntentionAction action = myFixture.findSingleIntention("Collapse"); assertNotNull(action); WriteCommandAction.runWriteCommandAction(getProject(), () -> action.invoke(getProject(), myFixture.getEditor(), file)); myFixture.checkResult(""" <a> <b/> </a>"""); }