public ListedHashTree getClonedTree() {
        return newTree;
    }
@Test
    @SuppressWarnings("ReferenceEquality")
    public void testCloning() throws Exception {
        ListedHashTree original = new ListedHashTree();
        GenericController controller = new GenericController();
        controller.setName("controller");
        Arguments args = new Arguments();
        args.setName("args");
        TestPlan plan = new TestPlan();
        plan.addParameter("server", "jakarta");
        original.add(controller, args);
        original.add(plan);
        ResultCollector listener = new ResultCollector();
        listener.setName("Collector");
        original.add(controller, listener);
        TreeCloner cloner = new TreeCloner();
        original.traverse(cloner);
        ListedHashTree newTree = cloner.getClonedTree();
        assertNotSame(original, newTree);
        assertEquals(original.size(), newTree.size());
        assertEquals(original.getTree(original.getArray()[0]).size(), newTree.getTree(newTree.getArray()[0]).size());
        assertNotSame(original.getArray()[0], newTree.getArray()[0]);
        assertEquals(((GenericController) original.getArray()[0]).getName(), ((GenericController) newTree
                .getArray()[0]).getName());
        assertSame(original.getTree(original.getArray()[0]).getArray()[1], newTree.getTree(newTree.getArray()[0])
                .getArray()[1]);
        TestPlan clonedTestPlan = (TestPlan) newTree.getArray()[1];
        clonedTestPlan.setRunningVersion(true);
        clonedTestPlan.recoverRunningVersion();
        assertFalse(plan.getUserDefinedVariablesAsProperty().isRunningVersion());
        assertTrue(clonedTestPlan.getUserDefinedVariablesAsProperty().isRunningVersion());
        Arguments vars = (Arguments) plan.getUserDefinedVariablesAsProperty().getObjectValue();
        PropertyIterator iter = ((CollectionProperty) vars.getProperty(Arguments.ARGUMENTS)).iterator();
        while (iter.hasNext()) {
            JMeterProperty argProp = iter.next();
            assertFalse(argProp.isRunningVersion());
            assertInstanceOf(Argument.class, argProp.getObjectValue());
            Argument arg = (Argument) argProp.getObjectValue();
            arg.setValue("yahoo");
            assertEquals("yahoo", arg.getValue());
        }
        vars = (Arguments) clonedTestPlan.getUserDefinedVariablesAsProperty().getObjectValue();
        iter = vars.propertyIterator();
        while (iter.hasNext()) {
            assertTrue(iter.next().isRunningVersion());
        }
    }