void () { Module module = new MockModule(getTestRootDisposable()); final MyElement element1 = getDomManager().createMockElement(MyElement.class, module, false); final MyElement element2 = getDomManager().createMockElement(MyElement.class, module, false); element2.ensureTagExists(); assertNull(element2.getChild().getChild().getGenericValue().getStringValue()); element1.getChild().getChild().getGenericValue().setStringValue("abc"); WriteCommandAction.runWriteCommandAction(getProject(), () -> element2.copyFrom(element1)); assertEquals("abc", element2.getChild().getChild().getGenericValue().getStringValue()); }