### Question:
ResourceBundleService extends TranslationService { public void changeLocale(ResourceBundle newValue) { if (newValue.equals(rb)) { return; } rb = newValue; notifyListeners(); } ResourceBundleService(ResourceBundle rb); void changeLocale(ResourceBundle newValue); @Override String translate(String key);  }### Answer:
@Test public void changeLocaleTest() { ResourceBundleService rbs = new ResourceBundleService(rbEN); final int[] calls = new int[] { 0 }; Runnable r = () -> calls[0] += 1; rbs.addListener(r); rbs.changeLocale(rbDE); Assert.assertEquals(1, calls[0]); rbs.changeLocale(rbDE); Assert.assertEquals(1, calls[0]); rbs.removeListener(r); }