void () { final PsiElementFactory factory = getFactory(); final PsiMethod method = factory.createMethodFromText( """ /** * Javadoc * @param p1 * @param p2 * @param p3 */ void m() {}""", null); final PsiDocComment docComment = method.getDocComment(); assertNotNull(docComment); final PsiDocTag[] tags = docComment.getTags(); ApplicationManager.getApplication().runWriteAction(() -> tags[1].delete()); assertEquals(""" /** * Javadoc * @param p1 * @param p3 */""", docComment.getText()); }