public function hasCommandHandler($handler)
    {
        if($handler instanceof CommandHandlerInterface) {
            $identifier = $handler->getIdentifier();
        } else {
            $identifier = $this->getIdentifier($handler);
        }

        return $this->getCommandChain()->getHandlers()->hasIdentifier($identifier);
    }