void () { configure("<a></a>\n<!--", "", XHtmlFileType.INSTANCE); CommandProcessor.getInstance().executeCommand(getProject(), () -> ApplicationManager.getApplication().runWriteAction(() -> doc.insertString(offset, " -")), "", null); List<IElementType> newTokens = EditorTestUtil.getAllTokens(highlighter); assertSame("Detecting wrong char in comment data", XmlTokenType.XML_BAD_CHARACTER, newTokens.get(newTokens.size() - 1)); }