@Override
    public void stop() throws Exception {
        LOG.info("Stopping DefaultLeaderRetrievalService.");

        synchronized (lock) {
            if (!running) {
                return;
            }
            running = false;
        }

        leaderRetrievalDriver.close();
    }
@Test
    void testErrorIsIgnoredAfterBeingStop() throws Exception {
        new Context() {
            {
                runTest(
                        () -> {
                            final Exception testException = new Exception("test exception");

                            leaderRetrievalService.stop();
                            testingLeaderRetrievalDriver.onFatalError(testException);

                            assertThat(testingListener.getError()).isNull();
                        });
            }
        };
    }