### Question:
WearBluetoothMediatorSettings { @VisibleForTesting SettingsObserver getSettingsObserver() { return mSettingsObserver; } WearBluetoothMediatorSettings(ContentResolver contentResolver); void addListener(Listener listener);  }### Answer:
@Test public void testNotifyListeners() { WearBluetoothMediatorSettings.SettingsObserver obs = mBluetoothSettings.getSettingsObserver(); Settings.System.putInt(cr, BLUETOOTH_SETTINGS_PREF_KEY, 1); obs.onChange(false, Settings.System.getUriFor(BLUETOOTH_SETTINGS_PREF_KEY)); verify(mockListener).onSettingsPreferenceBluetoothSettingChanged(true); reset(mockListener); Settings.System.putInt(cr, BLUETOOTH_SETTINGS_PREF_KEY, 0); obs.onChange(false, Settings.System.getUriFor(BLUETOOTH_SETTINGS_PREF_KEY)); verify(mockListener).onSettingsPreferenceBluetoothSettingChanged(false); reset(mockListener); Settings.Global.putInt(cr, Settings.Global.AIRPLANE_MODE_ON, 1); obs.onChange(false, Settings.Global.getUriFor(Settings.Global.AIRPLANE_MODE_ON)); verify(mockListener).onAirplaneModeSettingChanged(true); reset(mockListener); Settings.Global.putInt(cr, Settings.Global.AIRPLANE_MODE_ON, 0); obs.onChange(false, Settings.Global.getUriFor(Settings.Global.AIRPLANE_MODE_ON)); verify(mockListener).onAirplaneModeSettingChanged(false); reset(mockListener); }