/**
  * @param \PHP\Manipulator\TokenContainer $container
  * @param \PHP\Manipulator\Token $targetToken
  * @param \PHP\Manipulator\Token $newToken
  */
 protected function _insertToken(Token $newToken, Iterator $iterator)
 {
     $this->_container->insertTokenBefore($iterator->current(), $newToken);
 }
 /**
  * @covers \PHP\Manipulator\TokenContainer::insertTokenBefore
  * @covers \Exception
  */
 public function testInsertTokenBeforeThrowsExceptionIfAfterTokenNotExists()
 {
     $token1 = Token::factory('Token1');
     $token2 = Token::factory('Token2');
     $token3 = Token::factory('Token3');
     $container = new TokenContainer(array($token1));
     try {
         $container->insertTokenBefore($token2, $token3);
         $this->fail('Expected exception not thrown');
     } catch (\Exception $e) {
         $this->assertEquals("Container does not contain Token: {$token2}", $e->getMessage(), 'Wrong exception message');
     }
 }