protected ListedHashTree cloneTree(ListedHashTree tree) {
        TreeCloner cloner = new TreeCloner(true);
        tree.traverse(cloner);
        ListedHashTree clonedTree = cloner.getClonedTree();
        if (!clonedTree.isEmpty()) {
            Object firstElement = clonedTree.getArray()[0];
            Controller samplerController = ((AbstractDynamicThreadGroup) firstElement).getSamplerController();
            if (samplerController instanceof VirtualUserController) {
                assert owner != null;
                ((VirtualUserController) samplerController).setOwner(owner);
            }
        }
        return clonedTree;
    }
protected ListedHashTree cloneTree ( ListedHashTree tree ) { TreeCloner cloner = new TreeCloner ( true ) ; tree . traverse ( cloner ) ; ListedHashTree clonedTree = cloner . getClonedTree ( ) ; if ( ! clonedTree . isEmpty ( ) ) { Object firstElement = clonedTree . getArray ( ) [ 0 ] ; Controller samplerController = ( ( AbstractDynamicThreadGroup ) firstElement ) . getSamplerController ( ) ; if ( samplerController instanceof VirtualUserController ) { assert owner != null ; ( ( VirtualUserController ) samplerController ) . setOwner ( owner ) ; } } return clonedTree ; }
had to copy it from ThreadGroup