### Question:
XYZMaxZoomObserver implements Observer, Closeable { @Override public void close() { myLayer.getLayerInfo().deleteObserver(this); } XYZMaxZoomObserver(XYZDataTypeInfo layer, LayerActivationListener activationHandler); @Override void close(); @Override void update(Observable o, Object arg);  }### Answer:
@Test public void test() throws InterruptedException { EasyMockSupport support = new EasyMockSupport(); XYZTileLayerInfo layer = new XYZTileLayerInfo("theid", "A Name", Projection.EPSG_4326, 2, true, 4, new XYZServerInfo("serverName", "http: XYZDataTypeInfo xyzType = new XYZDataTypeInfo(null, layer); CountDownLatch latch = new CountDownLatch(1); LayerActivationListener listener = createListener(support, xyzType, latch); support.replayAll(); XYZMaxZoomObserver observer = new XYZMaxZoomObserver(xyzType, listener); layer.setMaxLevelsUser(10); latch.await(1, TimeUnit.SECONDS); observer.close(); layer.setMaxLevelsUser(13); support.verifyAll(); }