void () { final MyElement element = createElement("<a><child/></a>"); final MyElement child = element.getChild(); ApplicationManager.getApplication().runWriteAction(() -> element.undefine()); assertTrue(element.isValid()); assertFalse(child.isValid()); }