public function getGenerator()
    {
        if (!$this->generators) {
            $this->loadGenerators();
        }

        $generators = $this->generators;
        usort($generators, function ($a, $b) {
            return ($b::getPriority() - $a::getPriority());
        });

        $generator = null;
        if (isset ($generators[0])) {
            $class = $generators[0];
            $generator = new $class;
        }

        return $generator;
    }