function testTree2() {
  var treeBefore =
      'project()\n' +
      '-order_by(SimpleTable.salary DESC)\n' +
      '--table_access_by_row_id(SimpleTable)\n' +
      '---index_range_scan(' +
          'SimpleTable.idx_salary, [10000, unbound], reverse)\n';

  var treeAfter =
      'project()\n' +
      '-table_access_by_row_id(SimpleTable)\n' +
      '--index_range_scan(' +
          'SimpleTable.idx_salary, [10000, unbound], natural)\n';

  var constructTree = function() {
    var queryContext = new lf.query.SelectContext(db.getSchema());
    queryContext.from = [simpleTable];
    queryContext.where = simpleTable['salary'].gte(10000);
    queryContext.orderBy = [{
      column: simpleTable['salary'],
      order: lf.Order.DESC
    }];

    var rootNode = new lf.proc.ProjectStep([], null);
    var orderByNode = new lf.proc.OrderByStep(queryContext.orderBy);
    var tableAccessByRowIdNode = new lf.proc.TableAccessByRowIdStep(
        global, queryContext.from[0]);
    var indexRangeScanNode = new lf.proc.IndexRangeScanStep(
        global, simpleTable['salary'].getIndex(),
        new lf.testing.proc.MockKeyRangeCalculator(
            queryContext.where.toKeyRange()), true);
    tableAccessByRowIdNode.addChild(indexRangeScanNode);
    orderByNode.addChild(tableAccessByRowIdNode);
    rootNode.addChild(orderByNode);

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

  lf.testing.treeutil.assertTreeTransformation(
      constructTree(), treeBefore, treeAfter, pass);
}
Tests a tree where an IndexRangeScanStep for the same column used for
sorting already exists.