/**
  * @covers WindowsAzure\Table\TableRestProxy::updateEntity
  */
 private function createTargetEntity($table, $initialEnt, $concurType, $mutatePivot)
 {
     $targetEnt = TableServiceFunctionalTestUtils::cloneEntity($initialEnt);
     // Update the entity/table state to get the requested concurrency type error.
     switch ($concurType) {
         case ConcurType::NoKeyMatch:
             // Mutate the keys to not match.
             $targetEnt->setRowKey(TableServiceFunctionalTestData::getNewKey());
             break;
         case ConcurType::KeyMatchNoEtag:
             $targetEnt->setEtag(null);
             break;
         case ConcurType::KeyMatchEtagMismatch:
             $newEtag = $this->restProxy->updateEntity($table, $initialEnt)->getEtag();
             $initialEnt->setEtag($newEtag);
             // Now the $targetEnt Etag will not match.
             $this->assertTrue($targetEnt->getEtag() != $initialEnt->getEtag(), 'targetEnt->Etag(\'' . $targetEnt->getEtag() . '\') !=  updated->Etag(\'' . $initialEnt->getEtag() . '\')');
             break;
         case ConcurType::KeyMatchEtagMatch:
             // Don't worry here.
             break;
     }
     // Mutate the properties.
     TableServiceFunctionalTestUtils::mutateEntity($targetEnt, $mutatePivot);
     return $targetEnt;
 }