public function source(MockGenerator $generator = null): string
    {
        if (!$generator) {
            $generator = MockGenerator::instance();
        }

        return $generator->generate($this->definition());
    }