/**
  * Generates the HTML for a Reference object.
  *
  * @param Reference $reference
  *
  * @return string HTML
  */
 private function getHtmlForReference(Reference $reference)
 {
     $snaks = $reference->getSnaks();
     $referenceSnaksByProperty = new ByPropertyIdGrouper($snaks);
     $snaklistviewsHtml = '';
     foreach ($referenceSnaksByProperty->getPropertyIds() as $propertyId) {
         $snaklistviewsHtml .= $this->getSnaklistviewHtml($referenceSnaksByProperty->getByPropertyId($propertyId));
     }
     return $this->templateFactory->render('wikibase-referenceview', 'wikibase-referenceview-' . $reference->getHash(), $snaklistviewsHtml);
 }
 /**
  * @expectedException OutOfBoundsException
  */
 public function testGetByPropertyIdThrowsException()
 {
     $byPropertyIdGrouper = new ByPropertyIdGrouper($this->getPropertyIdProviders());
     $byPropertyIdGrouper->getByPropertyId(new PropertyId('P11'));
 }