protected static function generateNonLazyBeanCode(
        string $padding,
        string $beanId,
        string $beanType,
        Bean $beanMetadata,
        string $methodParams,
        ForceLazyInitProperty $forceLazyInitProperty,
        SessionBeansProperty $sessionBeansProperty,
        BeanPostProcessorsProperty $postProcessorsProperty,
        WrapBeanAsLazy $wrapBeanAsLazy
    ): string {
        $content = $padding . '$backupForceLazyInit = $this->' . $forceLazyInitProperty->getName() . ';' . PHP_EOL;

        if ($beanMetadata->isSession()) {
            $content .= $padding . 'if($this->' . $sessionBeansProperty->getName() . '->has("' . $beanId . '")) {'
                . PHP_EOL;
            if ($beanMetadata->isSingleton()) {
                $content .= $padding . '    $sessionInstance = clone $this->' . $sessionBeansProperty->getName()
                    . '->get("' . $beanId . '");' . PHP_EOL;
            } else {
                $content .= $padding . '    $sessionInstance = $this->' . $sessionBeansProperty->getName() . '->get("' .
                    $beanId . '");' . PHP_EOL;
            }
            $content .= $padding . '    return ($backupForceLazyInit) ? $this->' . $wrapBeanAsLazy->getName() . '("' .
                $beanId . '", "' . $beanType . '", $sessionInstance) : $sessionInstance;' . PHP_EOL;
            $content .= $padding . '}' . PHP_EOL;
        }

        if ($beanMetadata->isSingleton()) {
            $content .= $padding . 'static $instance = null;' . PHP_EOL;
            $content .= $padding . 'if ($instance !== null) {' . PHP_EOL;
            $content .= $padding . '    return ($backupForceLazyInit) ? $this->' . $wrapBeanAsLazy->getName() . '("' .
                $beanId . '", "' . $beanType . '", $instance) : $instance;' . PHP_EOL;
            $content .= $padding . '}' . PHP_EOL;
        }

        if ($beanMetadata->isSession()) {
            $content .= $padding . '$this->' . $forceLazyInitProperty->getName() . ' = true;' . PHP_EOL;
        }

        $content .= self::generateBeanCreationCode($padding, $beanId, $methodParams, $postProcessorsProperty);

        if ($beanMetadata->isSession()) {
            $content .= $padding . '$this->' . $forceLazyInitProperty->getName() . ' = $backupForceLazyInit;' . PHP_EOL;
            $content .= $padding . '$this->' . $sessionBeansProperty->getName() . '->add("' . $beanId . '", $instance);'
                . PHP_EOL;
        }

        $content .= $padding . 'return ($backupForceLazyInit) ? $this->' . $wrapBeanAsLazy->getName() . '("' .
            $beanId . '", "' . $beanType . '", $instance) : $instance;' . PHP_EOL;

        return $content;
    }