/**
  * @param UrlRewrite $url
  * @return Category|null|bool
  */
 protected function retrieveCategoryFromMetadata($url)
 {
     $metadata = $url->getMetadata();
     if (isset($metadata['category_id'])) {
         $category = $this->productCategories->get($metadata['category_id']);
         return $category === null ? false : $category;
     }
     return null;
 }
 public function testGetNotExistObject()
 {
     $this->assertEquals(null, $this->objectRegistry->get('no-id'));
 }