public function next()
{
if ($this->calledCount > $this->lastIndex) {
$index = $this->lastIndex;
} else {
$index = $this->calledCount;
}
++$this->calledCount;
if (!isset($this->answers[$index]) || !$this->answers[$index]->primaryRequest()) {
throw new UndefinedAnswerException();
}
return $this->answers[$index];
}