private function addMethods(PhpClass $class, array $methods)
 {
     foreach ($methods as $method) {
         $initializingCode = 'if (false === $this->' . $this->prefix . 'initialized) {' . "\n" . '    $this->' . $this->prefix . 'initialize();' . "\n" . '}';
         if ($class->hasMethod($method->name)) {
             $genMethod = $class->getMethod($method->name);
             $genMethod->setBody($initializingCode . "\n" . $genMethod->getBody());
             continue;
         }
         $genMethod = PhpMethod::fromReflection($method);
         $genMethod->setBody($initializingCode . "\n\n" . 'return ' . GeneratorUtils::callMethod($method) . ';');
         $class->setMethod($genMethod);
     }
 }