Correct usage of Factory::getGenerator