@Override
    public void shutdown() throws InterruptedException {
        try {
            super.shutdown();
        } finally {
            client.close();
        }
    }
@Test
    public void testShutdown() throws Exception {
        @SuppressWarnings("unchecked")
        KafkaRaftClient<String> raftClient = (KafkaRaftClient<String>) Mockito.mock(KafkaRaftClient.class);
        MockFaultHandler faultHandler = new MockFaultHandler("TestFaultHandler");
        KafkaRaftClientDriver<String> driver = new KafkaRaftClientDriver<>(
            raftClient,
            "test-raft",
            faultHandler,
            new LogContext()
        );

        when(raftClient.isRunning()).thenReturn(true);
        assertTrue(driver.isRunning());

        CompletableFuture<Void> shutdownFuture = new CompletableFuture<>();
        when(raftClient.shutdown(5000)).thenReturn(shutdownFuture);

        driver.initiateShutdown();
        assertTrue(driver.isRunning());
        assertTrue(driver.isShutdownInitiated());
        verify(raftClient).shutdown(5000);

        shutdownFuture.complete(null);
        when(raftClient.isRunning()).thenReturn(false);
        driver.run();
        assertFalse(driver.isRunning());
        assertTrue(driver.isShutdownComplete());
        assertNull(faultHandler.firstException());

        driver.shutdown();
        verify(raftClient).close();
    }