function testTree() {
  var d = schema.getDepartment();
  var e = schema.getEmployee();
  var j = schema.getJob();

  var treeBefore =
      'select(combined_pred_and)\n' +
      '-cross_product\n' +
      '--table_access(Employee)\n' +
      '--table_access(Job)\n' +
      '--table_access(Location)\n' +
      '--table_access(JobHistory)\n' +
      '--table_access(Department)\n';

  var treeAfter =
      'select(combined_pred_and)\n' +
      '-cross_product\n' +
      '--cross_product\n' +
      '---cross_product\n' +
      '----cross_product\n' +
      '-----table_access(Employee)\n' +
      '-----table_access(Job)\n' +
      '----table_access(Location)\n' +
      '---table_access(JobHistory)\n' +
      '--table_access(Department)\n';

  var constructTree = function() {
    var queryContext = new lf.query.SelectContext(hr.db.getSchema());
    queryContext.from = [e, j, schema.getLocation(), schema.getJobHistory(), d];
    queryContext.where = lf.op.and(e.jobId.eq(j.id), e.departmentId.eq(d.id));

    var crossProductNode = new lf.proc.CrossProductNode();
    queryContext.from.forEach(function(tableSchema) {
      crossProductNode.addChild(new lf.proc.TableAccessNode(tableSchema));
    });

    var selectNode = new lf.proc.SelectNode(queryContext.where);
    selectNode.addChild(crossProductNode);

    return {queryContext: queryContext, root: selectNode};
  };

  var pass = new lf.proc.CrossProductPass();
  lf.testing.treeutil.assertTreeTransformation(
      constructTree(), treeBefore, treeAfter, pass);
}
Tests a complex tree, where a CrossProductNode with many children exists.