public function generatePattern($type, $stepText)
    {
        foreach ($this->policies as $policy) {
            if ($policy->supportsPatternType($type)) {
                return $policy->generatePattern($stepText);
            }
        }

        throw new UnsupportedPatternTypeException(sprintf('Can not find policy for a pattern type `%s`.', $type), $type);
    }