/**
  * {@inheritdoc}
  */
 public function viewItem(ComplexDataInterface $item, $view_mode, $langcode = NULL)
 {
     try {
         if ($item instanceof EntityAdapter) {
             $entity = $item->getValue();
             $langcode = $langcode ?: $entity->language()->getId();
             return $this->getEntityManager()->getViewBuilder($this->getEntityTypeId())->view($entity, $view_mode, $langcode);
         }
     } catch (\Exception $e) {
         // The most common reason for this would be a
         // \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException in
         // getViewBuilder(), because the entity type definition doesn't specify a
         // view_builder class.
     }
     return array();
 }