### Question:
XYZSettingsBroker implements SettingsBroker { @Override public void saveSettings(XYZSettings settings) { myPreferences.putJAXBObject(settings.getLayerId(), settings, false, this); } XYZSettingsBroker(PreferencesRegistry prefsRegistry); @Override XYZSettings getSettings(XYZTileLayerInfo layer); @Override void saveSettings(XYZSettings settings);  }### Answer:
@Test public void testSaveSettings() { EasyMockSupport support = new EasyMockSupport(); XYZSettings settings = new XYZSettings(); settings.setLayerId(ourLayerId); settings.setMaxZoomLevelCurrent(12); settings.setMaxZoomLevelDefault(18); Preferences prefs = createPrefsSave(support, settings); PreferencesRegistry prefsRegistry = createPrefsRegistry(support, prefs); support.replayAll(); XYZSettingsBroker broker = new XYZSettingsBroker(prefsRegistry); broker.saveSettings(settings); support.verifyAll(); }