public static function register($type, Generator $generator)
    {
        if (array_key_exists($type, self::$generators)) {
            throw new DuplicateGeneratorException("A generator is already registred for $type.");
        }

        self::$generators[$type] = $generator;
    }