public function getCommand($class)
    {
        $parameters = func_get_args();
        array_shift($parameters);

        $reflection = new ReflectionClass($class);
        /** @var AbstractCommand $command */
        $command = empty($parameters) ?
            $reflection->newInstance() :
            $reflection->newInstanceArgs($parameters);

        $command->setCircuitBreakerFactory($this->circuitBreakerFactory);
        $command->setCommandMetricsFactory($this->commandMetricsFactory);
        $command->setServiceLocator($this->serviceLocator);
        $command->initializeConfig($this->config);

        if ($this->requestCache) {
            $command->setRequestCache($this->requestCache);
        }

        if ($this->requestLog) {
            $command->setRequestLog($this->requestLog);
        }

        return $command;
    }