function checkMap(rootNode) {
  // Attempting to copy the tree.
  var copy = lf.tree.map(rootNode, function(node) {
    return new TreeNode_(node.getId());
  });

  assertEquals(
      lf.tree.toString(rootNode, stringFn),
      lf.tree.toString(copy, stringFn));
}
Checks that the given tree is producing a tree with an identical structure
when cloned.
@param {!TreeNode_} rootNode