function assertMessages(result, numMessages) {
  assertEquals(numMessages, result.length);
  for (let i = 0; i < numMessages; i++) {
    assertElementsEquals(['1'], object.getKeys(result[i]));
  }
}
@param {!Array<!Object>} result The result to check
@param {number} numMessages The expected number of messages