public static function getInstance($clientId, $clientSecret, $redirectUri)
    {
        $driver = static::getLibrary();

        try {
            $instance = new $driver($clientId, $clientSecret, $redirectUri);
        } catch (\Exception $e) {
            throw new TwitterOAuthException('Unable to create an instance of ' . $driver);
        }

        if (!self::isInstanceOf($instance, TwitterOAuthInterface::class)) {
            throw new TwitterOAuthException(TwitterOAuthException::MSG_INVALID_ARG, ['driver', TwitterOAuthInterface::class]);
        }

        return $instance;
    }