function assertAttributes(obj, attributeNames, message) {
  attributeNames.forEach(function(attributeName) {
    if (!obj.hasOwnProperty(attributeName)) {
      throw new Error(
          'Missing attribute \'' + attributeName + '\' from ' + message);
    }
  });
}
Checks that the given attributes exist on the given object.
@param {!*} obj
@param {!Array<string>} attributeNames
@param {string} message Debug message.