public void registryDefaultSampleThreadPoolExecutor() {
        ApplicationModel applicationModel = collector.getApplicationModel();
        if (applicationModel == null) {
            return;
        }
        try {
            if (this.frameworkExecutorRepository == null) {
                this.frameworkExecutorRepository =
                        collector.getApplicationModel().getBeanFactory().getBean(FrameworkExecutorRepository.class);
            }
        } catch (Exception ex) {
            logger.warn(
                    COMMON_METRICS_COLLECTOR_EXCEPTION,
                    "",
                    "",
                    "ThreadPoolMetricsSampler! frameworkExecutorRepository non-init");
        }
        if (this.dataStore == null) {
            this.dataStore = collector
                    .getApplicationModel()
                    .getExtensionLoader(DataStore.class)
                    .getDefaultExtension();
        }

        if (dataStore != null) {
            dataStore.addListener(this);

            Map<String, Object> executors = dataStore.get(EXECUTOR_SERVICE_COMPONENT_KEY);
            for (Map.Entry<String, Object> entry : executors.entrySet()) {
                ExecutorService executor = (ExecutorService) entry.getValue();
                if (executor instanceof ThreadPoolExecutor) {
                    this.addExecutors(SERVER_THREAD_POOL_PREFIX + entry.getKey(), executor);
                }
            }
            executors = dataStore.get(CONSUMER_SHARED_EXECUTOR_SERVICE_COMPONENT_KEY);
            for (Map.Entry<String, Object> entry : executors.entrySet()) {
                ExecutorService executor = (ExecutorService) entry.getValue();
                if (executor instanceof ThreadPoolExecutor) {
                    this.addExecutors(CLIENT_THREAD_POOL_PREFIX + entry.getKey(), executor);
                }
            }

            ThreadRejectMetricsCountSampler threadRejectMetricsCountSampler =
                    new ThreadRejectMetricsCountSampler(collector);
            this.sampleThreadPoolExecutor.entrySet().stream()
                    .filter(entry -> entry.getKey().startsWith(SERVER_THREAD_POOL_NAME))
                    .forEach(entry -> {
                        if (entry.getValue().getRejectedExecutionHandler() instanceof AbortPolicyWithReport) {
                            MetricThreadPoolExhaustedListener metricThreadPoolExhaustedListener =
                                    new MetricThreadPoolExhaustedListener(
                                            entry.getKey(), threadRejectMetricsCountSampler);
                            ((AbortPolicyWithReport) entry.getValue().getRejectedExecutionHandler())
                                    .addThreadPoolExhaustedEventListener(metricThreadPoolExhaustedListener);
                        }
                    });
        }
        if (this.frameworkExecutorRepository != null) {
            this.addExecutors("sharedExecutor", frameworkExecutorRepository.getSharedExecutor());
        }
    }
@Test
    public void testRegistryDefaultSampleThreadPoolExecutor() throws NoSuchFieldException, IllegalAccessException {

        Map<String, Object> serverExecutors = new HashMap<>();
        Map<String, Object> clientExecutors = new HashMap<>();

        ExecutorService serverExecutor = Executors.newFixedThreadPool(5);
        ExecutorService clientExecutor = Executors.newFixedThreadPool(5);

        serverExecutors.put("server1", serverExecutor);
        clientExecutors.put("client1", clientExecutor);

        when(dataStore.get(EXECUTOR_SERVICE_COMPONENT_KEY)).thenReturn(serverExecutors);
        when(dataStore.get(CONSUMER_SHARED_EXECUTOR_SERVICE_COMPONENT_KEY)).thenReturn(clientExecutors);

        when(frameworkExecutorRepository.getSharedExecutor()).thenReturn(Executors.newFixedThreadPool(5));

        sampler2.registryDefaultSampleThreadPoolExecutor();

        Field f = ThreadPoolMetricsSampler.class.getDeclaredField("sampleThreadPoolExecutor");
        f.setAccessible(true);
        Map<String, ThreadPoolExecutor> executors = (Map<String, ThreadPoolExecutor>) f.get(sampler2);

        Assertions.assertEquals(3, executors.size());
        Assertions.assertTrue(executors.containsKey("DubboServerHandler-server1"));
        Assertions.assertTrue(executors.containsKey("DubboClientHandler-client1"));
        Assertions.assertTrue(executors.containsKey("sharedExecutor"));

        serverExecutor.shutdown();
        clientExecutor.shutdown();
    }