protected function createEmbeddedTypeMap()
 {
     $entity_type_map = parent::createEmbeddedTypeMap();
     foreach ($entity_type_map as $embedded_type) {
         $entity_implementor = $embedded_type->getEntityImplementor();
         $entity_reflection = new ReflectionClass($entity_implementor);
         if (!$entity_reflection->implementsInterface(EntityReferenceInterface::CLASS)) {
             throw new RuntimeException(sprintf('Invalid reference-type (%s) given to %s. Only instance of %s accepted.', $this->getName(), $entity_implementor, EntityReferenceInterface::CLASS));
         }
     }
     return $entity_type_map;
 }