void () { final MyElement root = getDomManager().createMockElement(MyElement.class, null, true); final MyElement element = WriteCommandAction.writeCommandAction(getProject()).compute(() -> root.addChildElement()); assertTrue(root.isValid()); assertNotNull(element.getXmlElement()); }