public void shutdown() {
        synchronized (lock) {
            if (closed) {
                return;
            }
            closed = true;
            executorFactoryByJobId.clear();
            LOG.info("Shutting down TaskExecutorChannelStateExecutorFactoryManager.");
        }
    }
@Test
    void testShutdown() {
        TaskExecutorChannelStateExecutorFactoryManager manager =
                new TaskExecutorChannelStateExecutorFactoryManager();

        JobID jobID = new JobID();
        manager.getOrCreateExecutorFactory(jobID);
        manager.shutdown();

        assertThatThrownBy(() -> manager.getOrCreateExecutorFactory(jobID))
                .isInstanceOf(IllegalStateException.class);
        assertThatThrownBy(() -> manager.getOrCreateExecutorFactory(new JobID()))
                .isInstanceOf(IllegalStateException.class);
    }