### Question:
Logger implements LogProducer,Configurable { public boolean hasListeners() { return !listeners.isEmpty(); } Logger(); Configuration getConfiguration(); @Override void setConfiguration(Configuration cfg); void addListener(LogListener l); void removeListener(LogListener l); void removeAllListeners(); static void log(LogEvent evt); void setName(String name); void destroy(); synchronized static Logger getLogger(String name); String getName(); boolean hasListeners(); static final String NRPREFIX; }### Answer:
@Test public void testHasListeners() throws Throwable { Logger logger = new Logger(); logger.addListener(new SimpleLogListener()); boolean result = logger.hasListeners(); assertTrue(result, "result"); }
@Test public void testHasListeners1() throws Throwable { boolean result = new Logger().hasListeners(); assertFalse(result, "result"); }