static Optional<ExecutorService> lookupExecutorServiceRef(
            CamelContext camelContext, String name, Object source, String executorServiceRef) {
        ExecutorServiceManager manager = camelContext.getExecutorServiceManager();
        ObjectHelper.notNull(manager, ESM_NAME);
        ObjectHelper.notNull(executorServiceRef, "executorServiceRef");
        // lookup in registry first and use existing thread pool if exists,
        // or create a new thread pool, assuming that the executor service ref is a thread pool ID
        return lookupByNameAndType(camelContext, executorServiceRef, ExecutorService.class)
                .or(() -> Optional.ofNullable(manager.newThreadPool(source, name, executorServiceRef)));
    }
@Test
    void testLookupExecutorServiceRefWithNewThreadPool() {
        String name = "ThreadPool";
        Object source = new Object();
        String executorServiceRef = "NewThreadPool";
        when(camelContext.getExecutorServiceManager()).thenReturn(manager);
        when(manager.newThreadPool(source, name, executorServiceRef)).thenReturn(newThreadPool);
        when(camelContext.getRegistry()).thenReturn(mockRegistry);
        Optional<ExecutorService> executorService
                = DynamicRouterRecipientListHelper.lookupExecutorServiceRef(camelContext, name, source, executorServiceRef);
        Assertions.assertTrue(executorService.isPresent());
        Assertions.assertEquals(newThreadPool, executorService.get());
    }