@Override
    public boolean isRunning() {
        return client.isRunning() && !isThreadFailed();
    }
@Test
    public void testUncaughtException() {
        @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());

        RuntimeException exception = new RuntimeException();
        Mockito.doThrow(exception).when(raftClient).poll();
        driver.run();

        assertTrue(driver.isShutdownComplete());
        assertTrue(driver.isThreadFailed());
        assertFalse(driver.isRunning());

        Throwable caughtException = faultHandler.firstException().getCause();
        assertEquals(exception, caughtException);
    }