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

  var stats = tree.stats();
  assertEquals(23, stats.totalRows);
  assertEquals(expectedMaxKeyEncountered, stats.maxKeyEncountered);

  // Testing deletions.
  tree.remove(9);
  tree.remove(17);
  tree.remove(21);
  assertEquals(20, stats.totalRows);

  // Testing additions.
  tree.add(9, 9);
  tree.add(21, 21);
  assertEquals(22, stats.totalRows);

  // Testing replacements.
  tree.set(9, 8);
  assertEquals(22, stats.totalRows);

  // Testing stats.maxKeyEncountered.
  tree.set(999, 888);
  assertEquals(23, stats.totalRows);
  expectedMaxKeyEncountered = 999;
  assertEquals(expectedMaxKeyEncountered, stats.maxKeyEncountered);

  // Testing removing everything from the index.
  tree.clear();
  assertEquals(0, stats.totalRows);
  assertEquals(expectedMaxKeyEncountered, stats.maxKeyEncountered);

  for (var i = 0; i < 23; ++i) {
    tree.set(i, i);
  }
  assertEquals(23, tree.stats().totalRows);

  // Test stats after serialization/deserialization.
  var rows = insertToTree(23, false).serialize();
  var deserializedTree = lf.index.BTree.deserialize(c, 'dummyTree', true, rows);
  assertEquals(23, deserializedTree.stats().totalRows);
}
Tests the stats of a unique tree (each key has only one associated value).