void () { final MyElement element = createElement("<a><indicator/></a>"); final GenericDomValue<Boolean> indicator = element.getIndicator(); assertTrue(indicator.getValue()); indicator.setValue(false); assertFalse(indicator.getValue()); assertNull(indicator.getStringValue()); assertNull(indicator.getXmlTag()); assertEquals(0, element.getXmlTag().getSubTags().length); putExpected(new DomEvent(indicator, false)); assertResultsAndClear(); indicator.setValue(true); assertTrue(indicator.getValue()); assertEquals("", indicator.getStringValue()); assertSame(indicator.getXmlTag(), element.getXmlTag().getSubTags()[0]); final DomElement element1 = indicator; putExpected(new DomEvent(element1, true)); assertResultsAndClear(); final XmlTag tag = element.getXmlTag(); WriteCommandAction.runWriteCommandAction(getProject(), () -> { tag.add(createTag("<indicator/>")); tag.add(createTag("<indicator/>")); }); assertTrue(element.isValid()); assertTrue(element.getIndicator().getValue()); element.getIndicator().setValue(false); assertFalse(element.getIndicator().getValue()); assertEquals(0, element.getXmlTag().findSubTags("indicator").length); }