StroomLogger { public void ifDebugIsEnabled(final Action action) { if (isDebugEnabled()) { action.doWork(); } } private  StroomLogger(final Logger logger); final static StroomLogger getLogger(final Class<?> clazz); boolean checkInterval(); void setInterval(final long interval); void debugInterval(final Object... args); void traceInterval(final Object... args); void infoInterval(final Object... args); String buildMessage(final Object... args); Throwable extractThrowable(final Object... args); void trace(final Object... args); void trace(final Supplier<String> msgSupplier, final Throwable e); void trace(final Supplier<String> msgSupplier); void debug(final Object... args); void debug(final Supplier<String> msgSupplier, final Throwable e); void debug(final Supplier<String> msgSupplier); void info(final Object... args); void info(final Supplier<String> msgSupplier, final Throwable e); void info(final Supplier<String> msgSupplier); void warn(final Object... args); void warn(final Supplier<String> msgSupplier, final Throwable e); void warn(final Supplier<String> msgSupplier); void error(final Object... args); void error(final Supplier<String> msgSupplier, final Throwable e); void error(final Supplier<String> msgSupplier); void fatal(final Object... args); void fatal(final Supplier<String> msgSupplier, final Throwable e); void fatal(final Supplier<String> msgSupplier); boolean isTraceEnabled(); boolean isDebugEnabled(); boolean isInfoEnabled(); void ifTraceIsEnabled(final Action action); void ifDebugIsEnabled(final Action action); void log(final String callerFQCN, final Priority level, final Object message, final Throwable t); void log(final Level level, final Supplier<String> msgSupplier, final Throwable e); void log(final Level level, final BooleanSupplier enabledFunction, final Supplier<String> msgSupplier,
            final Throwable e);  }
@Test public void testIfDebugIsEnabled() { final StroomLogger stroomLogger = StroomLogger.getLogger(TestStroomLogger.class); final AtomicInteger counter = new AtomicInteger(0); stroomLogger.ifDebugIsEnabled(() -> counter.incrementAndGet()); Assert.assertEquals(stroomLogger.isDebugEnabled() ? 1 : 0, counter.get()); }