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

    tools.registerNodeTypes(session, "cnd/autocreated-child-nodes.cnd");
    Node parent = session.getRootNode().addNode("parent", "test:autocreatedFolders");
    session.save();
    Node folder1 = parent.getNode("folder1");
    long folder1CreatedTs = folder1.getProperty("jcr:created").getDate().getTimeInMillis();
    Node folder2 = parent.getNode("folder2");
    long folder2CreatedTs = folder2.getProperty("jcr:created").getDate().getTimeInMillis();
    otherWorkspace.clone(workspaceName, "/parent", "/parent", true);
    AbstractJcrNode otherParent = otherSession.getNode("/parent");
    assertEquals(2, otherParent.getNodes().getSize());
    Node otherFolder1 = otherSession.getNode("/parent/folder1");
    assertEquals(folder1CreatedTs, otherFolder1.getProperty("jcr:created").getDate().getTimeInMillis());
    assertEquals(folder1.getIdentifier(), otherFolder1.getIdentifier());
    Node otherFolder2 = otherSession.getNode("/parent/folder2");
    assertEquals(folder2.getIdentifier(), otherFolder2.getIdentifier());
    assertEquals(folder2CreatedTs, otherFolder2.getProperty("jcr:created").getDate().getTimeInMillis());
}