void () { final PsiClass aClass = getJavaFacade().getElementFactory().createClassFromText("public int i, j;", null); final PsiField aField = aClass.getFields()[0]; WriteCommandAction.runWriteCommandAction(null, () -> aField.delete()); assertEquals("public int j;", aClass.getFields()[0].getText()); }