ChatLogger implements SettingsListener { public boolean isOpen() { return open; } ChatLogger(final Settings settings, final ErrorHandler errorHandler);  ChatLogger(final String logFilePrefix, final Settings settings, final ErrorHandler errorHandler); void open(); void close(); void append(final String line); boolean isOpen(); @Override void settingChanged(final Setting setting);  }
@Test public void settingsListenerShouldEnableAndDisableLoggingBasedOnChangedSetting() { assertFalse(chatLogger.isOpen()); settings.setLogging(true); assertTrue(chatLogger.isOpen()); settings.setLogging(false); assertFalse(chatLogger.isOpen()); }