function assertIndexContents(indexSchema, serializedRows, dataRows) {
  // Expecting at least one row for each index.
  assertTrue(serializedRows.length >= 1);

  // Reconstructing the index and ensuring it contains all expected keys.
  var comparator = lf.index.ComparatorFactory.create(indexSchema);
  var btreeIndex = lf.index.BTree.deserialize(
      comparator,
      indexSchema.getNormalizedName(),
      indexSchema.isUnique,
      serializedRows);
  assertEquals(dataRows.length, btreeIndex.getRange().length);

  dataRows.forEach(function(row) {
    var expectedKey = /** @type {!lf.index.Index.Key} */ (
        row.keyOfIndex(indexSchema.getNormalizedName()));
    assertTrue(btreeIndex.containsKey(expectedKey));
  });
}
Asserts that the contens of the given persistent index appear as expected in
the backing store.
@param {!lf.schema.Index} indexSchema
@param {!Array<!lf.Row>} serializedRows The serialized version of the index.
@param {!Array<!lf.Row>} dataRows The rows that hold the actual data (not
    index data).