/**
  * Creates a new iterator over a sequence
  *
  * @param  util.data.Sequence $seq
  * @throws lang.IllegalStateException If the sequence has been processed
  */
 public function __construct(Sequence $seq)
 {
     $this->it = $seq->getIterator();
     try {
         $this->it->rewind();
     } catch (\Exception $e) {
         throw new IllegalStateException($e->getMessage());
     }
 }