JMeterTreeNode root = (JMeterTreeNode) treeModel.getRoot();
treeModel.addSubTree(tree, root);
// Hack to resolve ModuleControllers in non GUI mode
SearchByClass<ReplaceableController> replaceableControllers = new SearchByClass<ReplaceableController>(ReplaceableController.class);
tree.traverse(replaceableControllers);
Collection<ReplaceableController> replaceableControllersRes = replaceableControllers.getSearchResults();
for (Iterator<ReplaceableController> iter = replaceableControllersRes.iterator(); iter.hasNext();) {
ReplaceableController replaceableController = iter.next();
replaceableController.resolveReplacementSubTree(root);
}