### Question:
XYZMantleController extends DataRegistryListenerAdapter<XYZTileLayerInfo> { @Override public void allValuesRemoved(Object source) { List<Long> idsToRemove = New.list(myLayerGroups.keySet()); for (Long id : idsToRemove) { removeLayer(id); } } XYZMantleController(Toolbox toolbox); @Override void allValuesRemoved(Object source); void close(); @Override boolean isIdArrayNeeded(); @Override void valuesAdded(DataModelCategory dataModelCategory, long[] ids, Iterable<? extends XYZTileLayerInfo> newValues,
            Object source); @Override void valuesRemoved(DataModelCategory dataModelCategory, long[] ids, Object source);  }### Answer:
@Test public void testAllValuesRemoved() { myAddedRootGroup = null; EasyMockSupport support = new EasyMockSupport(); DataGroupController groupController = createGroupController(support, true, null); DataRegistry dataRegistry = createDataRegistry(support); OrderManagerRegistry orderRegistry = createOrderRegistry(support, 2); Toolbox toolbox = createToolbox(support, groupController, dataRegistry, orderRegistry); support.replayAll(); XYZMantleController controller = new XYZMantleController(toolbox); controller.valuesAdded(new DataModelCategory(null, XYZTileUtils.LAYERS_FAMILY, null), new long[] { 0, 1 }, New.list(ourLayerInfo1, ourLayerInfo2), this); assertNotNull(myAddedRootGroup); Collection<DataGroupInfo> children = myAddedRootGroup.getChildren(); assertEquals(2, children.size()); controller.allValuesRemoved(this); assertEquals(0, myAddedRootGroup.getChildren().size()); controller.close(); support.verifyAll(); }