function testStats_NonUniqueTree() {
  var tree = insertToTree(23, true);
  var expectedMaxKeyEncountered = Math.max.apply(null, SEQUENCE);

  var stats = tree.stats();
  assertEquals(46, stats.totalRows);
  assertEquals(expectedMaxKeyEncountered, stats.maxKeyEncountered);
  // Remove all rows for the given key.
  tree.remove(21);
  assertEquals(44, stats.totalRows);
  // Remove only one row for the given key.
  tree.remove(17, 17);
  assertEquals(43, stats.totalRows);
  tree.remove(17, 9999);  // remove non-existing row
  assertEquals(43, stats.totalRows);
  tree.set(17, 7777);
  tree.add(17, 8888);
  tree.add(17, 9999);
  assertEquals(45, stats.totalRows);
  tree.add(9, 889);
  assertEquals(46, stats.totalRows);
  tree.remove(9);
  assertEquals(43, stats.totalRows);
  assertEquals(expectedMaxKeyEncountered, stats.maxKeyEncountered);

  var rows = tree.serialize();
  var deserializedTree =
      lf.index.BTree.deserialize(c, 'dummyTree', false, rows);
  assertEquals(43, deserializedTree.stats().totalRows);
  assertEquals(
      expectedMaxKeyEncountered, deserializedTree.stats().maxKeyEncountered);
}
Tests the stats of a non-unique tree where each key has two associated
values.