private int scanToNextId() {
        while (iterator.hasNextId()) {
          int next = iterator.nextId();
          if (!extraRecordsIds.get(next)) return next;
        }
        return -1;
      }
private int scanToNextId()