### Question:
XYZSettingsBroker implements SettingsBroker { @Override public XYZSettings getSettings(XYZTileLayerInfo layer) { XYZSettings defaultSettings = new XYZSettings(); defaultSettings.setLayerId(layer.getName()); defaultSettings.setMaxZoomLevelCurrent(layer.getMaxLevels()); defaultSettings.setMaxZoomLevelDefault(layer.getMaxLevelsDefault()); XYZSettings settings = myPreferences.getJAXBObject(XYZSettings.class, layer.getName(), defaultSettings); settings.setMaxZoomLevelDefault(layer.getMaxLevelsDefault()); return settings; } XYZSettingsBroker(PreferencesRegistry prefsRegistry); @Override XYZSettings getSettings(XYZTileLayerInfo layer); @Override void saveSettings(XYZSettings settings);  }### Answer:
@Test public void testGetSettings() { EasyMockSupport support = new EasyMockSupport(); XYZTileLayerInfo layer = new XYZTileLayerInfo(ourLayerId, "A Name", Projection.EPSG_4326, 2, true, 4, new XYZServerInfo("serverName", "http: layer.setMaxLevels(18); layer.setMaxLevelsUser(14); Preferences prefs = createPrefsRead(support, layer); PreferencesRegistry prefsRegistry = createPrefsRegistry(support, prefs); support.replayAll(); XYZSettingsBroker broker = new XYZSettingsBroker(prefsRegistry); XYZSettings settings = broker.getSettings(layer); assertEquals(ourLayerId, settings.getLayerId()); assertEquals(18, settings.getMaxZoomLevelDefault()); assertEquals(14, settings.getMaxZoomLevelCurrent()); support.verifyAll(); }