public function createObject($builder, $parameters = array()) {
        if (is_string($builder)) {
            if (class_exists($builder)) {
                $response = $parameters['response'];
                $nextMiddleware = $parameters['next'];

                if ($response == null) {
                    throw new InvalidArgumentException("'response' parameters must be 'Psr\Http\Message\ResponseInterface' instance.");
                }

                if ($nextMiddleware != null) {
                    if (($nextMiddleware instanceof BaseMiddleware) == false) {
                        throw new InvalidArgumentException("'next' parameters must be 'Ken\Http\BaseMiddleware' instance.");
                    }
                }

                return new $builder($response, $nextMiddleware);
            }

            throw new InvalidArgumentException("Class '{$builder}' not found.");
        }

        throw new InvalidArgumentException("'builder' must be a fully qualified namespace of middleware class.");
    }