public function getRepository($key)
    {
        $repository = $this->tryGetRepository($key);
        if ($repository === null) {
            throw new \OutOfBoundsException($key.' does not exist in the registry');
        }
        return $repository;
    }