public function registerResponseClass($name, $class)
    {
        $this->responseClasses[$name] = $class;
        // set retrospectively if method already encountered
        if ($this->serviceDescription !== null
            && $this->hasOperation($name) === true
        ) {
            throw new \LogicException(
                "Too late to add new response class, {$name} operation has already been defined. "
                .'If you want to add a new response class, call reset() method first, add new response class '
                .'and run build again.'
            );
        }
        return $this;
    }