void () { WriteCommandAction.runWriteCommandAction(getProject(), () -> { DocumentImpl document = new DocumentImpl(""); assertEquals(0, document.getLineCount()); document.insertString(0, "a"); assertEquals(1, document.getLineCount()); document.deleteString(0, 1); assertEquals(0, document.getLineCount()); }); }