function checkFlatten(expected, rows, fields, opt_tablePrefix) {
  var actual =
      rows.map(function(obj) {
            var objToCheck =
                opt_tablePrefix != null ? obj[opt_tablePrefix] : obj;
    assertEquals(fields.length, Object.keys(objToCheck).length);
            return fields
                .map(function(name) {
      return objToCheck[name].toString();
                })
                .join(' ');
          })
          .join(' ');
  assertEquals(expected, actual);
}
@param {string} expected
@param {!Array<!Object>} rows
@param {!Array<string>} fields
@param {string=} opt_tablePrefix