InfiniteChecker.prototype.check = function () {
  this.count += 1;
  if (this.count > this.maxIterations) {
    throw new Error('Infinite loop detected - reached max iterations')
  }