@Test
@FixFor( "MODE-2115" )
public void copiedNodesShouldReplaceReferenceableAutoCreatedChildren() throws Exception {

    tools.registerNodeTypes(session, "cnd/autocreated-child-nodes.cnd");
    session.getRootNode().addNode("parent", "test:autocreatedReferenceableChildren");
    session.save();
    session.getNode("/parent/child1").addNode("child1_1");
    session.save();
    workspace.copy("/parent", "/new_parent");
    AbstractJcrNode newParent = session.getNode("/new_parent");
    assertEquals(2, newParent.getNodes().getSize());
    // validate that the jcr:uuid is the same as the identifier of the node
    Node child1 = assertNode("/new_parent/child1", "test:subnodeReferenceable");
    assertEquals(child1.getIdentifier(), child1.getProperty("jcr:uuid").getString());
    Node child2 = assertNode("/new_parent/child2", "test:subnodeReferenceable");
    assertEquals(child2.getIdentifier(), child2.getProperty("jcr:uuid").getString());
    assertNode("/new_parent/child1/child1_1");
}