### Question:
XYZSettingsController implements Observer, Closeable { @Override public void close() throws WebServiceException { myModel.deleteObserver(this); } XYZSettingsController(SettingsBroker saver, XYZTileLayerInfo layer, XYZSettings model); @Override void close(); @Override void update(Observable o, Object arg);  }### Answer:
@Test public void test() { EasyMockSupport support = new EasyMockSupport(); XYZSettings model = new XYZSettings(); SettingsBroker saver = support.createMock(SettingsBroker.class); saver.saveSettings(EasyMock.eq(model)); XYZTileLayerInfo layer = new XYZTileLayerInfo("theid", "A Name", Projection.EPSG_4326, 2, true, 4, new XYZServerInfo("serverName", "http: support.replayAll(); XYZSettingsController controller = new XYZSettingsController(saver, layer, model); assertEquals(18, layer.getMaxLevels()); model.setMaxZoomLevelCurrent(12); assertEquals(12, layer.getMaxLevels()); controller.close(); model.setMaxZoomLevelCurrent(10); assertEquals(12, layer.getMaxLevels()); assertEquals(5, model.getMinZoomLevel()); support.verifyAll(); }