@Test
    public void testHandleFault() {
        AtomicInteger counter = new AtomicInteger(0);
        LoggingFaultHandler handler = new LoggingFaultHandler("test", () -> {
            counter.incrementAndGet();
        });
        handler.handleFault("uh oh");
        assertEquals(1, counter.get());
        handler.handleFault("uh oh", new RuntimeException("yikes"));
        assertEquals(2, counter.get());
    }
Test handling faults with and without exceptions.
server-common/src/test/java/org/apache/kafka/server/fault/LoggingFaultHandlerTest.java