protected function _create($class, $alias, $config)
    {
        $instance = null;

        if (is_object($class)) {
            $instance = $class;
        }

        if (!$instance) {
            $instance = new $class($config);
        }

        if ($instance instanceof AbstractTransport) {
            return $instance;
        }

        throw new RuntimeException(
            'Mailer transports must use Cake\Mailer\AbstractTransport as a base class.'
        );
    }