AbstractLogger implements Logger { @Override public void removeListener(LoggerEventListener listener) { requireNonNull(listener); listeners.remove(listener); } AbstractLogger(final String name, final LoggerFormatter formatter); @Override Level getLevel(); @Override void setLevel(Level level); String getName(); @Override void setFormatter(LoggerFormatter formatter); @Override LoggerFormatter getFormatter(); @Override void addListener(LoggerEventListener listener); @Override void removeListener(LoggerEventListener listener); @Override void trace(String message); @Override void trace(Throwable throwable); @Override void trace(String format, Object arg); @Override void trace(String format, Object arg1, Object arg2); @Override void trace(String format, Object arg1, Object arg2, Object arg3); @Override void trace(String format, Object arg1, Object arg2, Object arg3, Object... args); @Override void trace(Throwable throwable, String message); @Override void trace(Throwable throwable, String format, Object arg); @Override void trace(Throwable throwable, String format, Object arg1, Object arg2); @Override void trace(Throwable throwable, String format, Object arg1, Object arg2, Object arg3); @Override void trace(Throwable throwable, String format, Object arg1, Object arg2, Object arg3, Object... args); @Override void debug(String message); @Override void debug(Throwable throwable); @Override void debug(String format, Object arg); @Override void debug(String format, Object arg1, Object arg2); @Override void debug(String format, Object arg1, Object arg2, Object arg3); @Override void debug(String format, Object arg1, Object arg2, Object arg3, Object... args); @Override void debug(Throwable throwable, String message); @Override void debug(Throwable throwable, String format, Object arg); @Override void debug(Throwable throwable, String format, Object arg1, Object arg2); @Override void debug(Throwable throwable, String format, Object arg1, Object arg2, Object arg3); @Override void debug(Throwable throwable, String format, Object arg1, Object arg2, Object arg3, Object... args); @Override void info(String message); @Override void info(Throwable throwable); @Override void info(String format, Object arg); @Override void info(String format, Object arg1, Object arg2); @Override void info(String format, Object arg1, Object arg2, Object arg3); @Override void info(String format, Object arg1, Object arg2, Object arg3, Object... args); @Override void info(Throwable throwable, String message); @Override void info(Throwable throwable, String format, Object arg); @Override void info(Throwable throwable, String format, Object arg1, Object arg2); @Override void info(Throwable throwable, String format, Object arg1, Object arg2, Object arg3); @Override void info(Throwable throwable, String format, Object arg1, Object arg2, Object arg3, Object... args); @Override void warn(String message); @Override void warn(Throwable throwable); @Override void warn(String format, Object arg); @Override void warn(String format, Object arg1, Object arg2); @Override void warn(String format, Object arg1, Object arg2, Object arg3); @Override void warn(String format, Object arg1, Object arg2, Object arg3, Object... args); @Override void warn(Throwable throwable, String message); @Override void warn(Throwable throwable, String format, Object arg); @Override void warn(Throwable throwable, String format, Object arg1, Object arg2); @Override void warn(Throwable throwable, String format, Object arg1, Object arg2, Object arg3); @Override void warn(Throwable throwable, String format, Object arg1, Object arg2, Object arg3, Object... args); @Override void error(String message); @Override void error(Throwable throwable); @Override void error(String format, Object arg); @Override void error(String format, Object arg1, Object arg2); @Override void error(String format, Object arg1, Object arg2, Object arg3); @Override void error(String format, Object arg1, Object arg2, Object arg3, Object... args); @Override void error(Throwable throwable, String message); @Override void error(Throwable throwable, String format, Object arg); @Override void error(Throwable throwable, String format, Object arg1, Object arg2); @Override void error(Throwable throwable, String format, Object arg1, Object arg2, Object arg3); @Override void error(Throwable throwable, String format, Object arg1, Object arg2, Object arg3, Object... args); @Override void fatal(String message); @Override void fatal(Throwable throwable); @Override void fatal(String format, Object arg); @Override void fatal(String format, Object arg1, Object arg2); @Override void fatal(String format, Object arg1, Object arg2, Object arg3); @Override void fatal(String format, Object arg1, Object arg2, Object arg3, Object... args); @Override void fatal(Throwable throwable, String message); @Override void fatal(Throwable throwable, String format, Object arg1, Object arg2); @Override void fatal(Throwable throwable, String format, Object arg); @Override void fatal(Throwable throwable, String format, Object arg1, Object arg2, Object arg3); @Override void fatal(Throwable throwable, String format, Object arg1, Object arg2, Object arg3, Object... args);  }
@Test void removeListener() { final AtomicReference<LoggerEvent> event = new AtomicReference<>(); final LoggerEventListener listener = event::set; instance.addListener(listener); instance.removeListener(listener); instance.fatal("Olle"); assertNull(event.get()); instance.removeListener(listener); }