public static RateLimiterAlgorithm<?> newInstance(final String name) {
        return Optional.ofNullable(ExtensionLoader.getExtensionLoader(RateLimiterAlgorithm.class).getJoin(name)).orElseGet(TokenBucketRateLimiterAlgorithm::new);
    }
@Test
    public void newInstanceTest() {
        RateLimiterAlgorithm<?> leakyBucketLimiterAlgorithm = RateLimiterAlgorithmFactory.newInstance("leakyBucket");
        assertThat(leakyBucketLimiterAlgorithm.getClass().getName(), is("org.apache.shenyu.plugin.ratelimiter.algorithm.LeakyBucketRateLimiterAlgorithm"));

        RateLimiterAlgorithm<?> concurrentRateLimiterAlgorithm = RateLimiterAlgorithmFactory.newInstance("concurrent");
        assertThat(concurrentRateLimiterAlgorithm.getClass().getName(), is("org.apache.shenyu.plugin.ratelimiter.algorithm.ConcurrentRateLimiterAlgorithm"));

        RateLimiterAlgorithm<?> tokenBucketRateLimiterAlgorithm = RateLimiterAlgorithmFactory.newInstance("tokenBucket");
        assertThat(tokenBucketRateLimiterAlgorithm.getClass().getName(), is("org.apache.shenyu.plugin.ratelimiter.algorithm.TokenBucketRateLimiterAlgorithm"));

        RateLimiterAlgorithm<?> slidingWindowRateLimiterAlgorithm = RateLimiterAlgorithmFactory.newInstance("slidingWindow");
        assertThat(slidingWindowRateLimiterAlgorithm.getClass().getName(), is("org.apache.shenyu.plugin.ratelimiter.algorithm.SlidingWindowRateLimiterAlgorithm"));
    }