void (Runnable action) { List<IElementType> oldTokens = EditorTestUtil.getAllTokens(highlighter); CommandProcessor.getInstance().executeCommand(getProject(), () -> ApplicationManager.getApplication().runWriteAction(action), "", null); List<IElementType> newTokens = EditorTestUtil.getAllTokens(highlighter); assertEquals(oldTokens, newTokens); }