function constructTreeWithPredicates(predicates) {
  var queryContext = new lf.query.SelectContext(schema);
  queryContext.from = [e];
  queryContext.where = lf.op.and.apply(null, predicates);

  var tableAccessNode = new lf.proc.TableAccessFullStep(
      global, queryContext.from[0]);
  var selectNodes = predicates.map(function(predicate) {
    return new lf.proc.SelectStep(predicate.getId());
  });
  var projectNode = new lf.proc.ProjectStep([], null);
  var lastSelectNode = selectNodes[0];
  projectNode.addChild(lastSelectNode);
  for (var i = 1; i < selectNodes.length; i++) {
    lastSelectNode.addChild(selectNodes[i]);
    lastSelectNode = selectNodes[i];
  }
  selectNodes[selectNodes.length - 1].addChild(tableAccessNode);

  return {
    queryContext: queryContext,
    root: projectNode
  };
}
Constructs a tree with multiple predicates.
@param {!Array<!lf.Predicate>} predicates
@return {lf.testing.treeutil.Tree} The constructed tree and corresponding
    query context.