### Question:
STKDataGroupController extends DataRegistryListenerAdapter<TileSet> { public void close() { myDataRegistry.removeChangeListener(this); myGroupController.removeDataGroupInfo(myRootGroup, this); } STKDataGroupController(Toolbox toolbox, String serverName, String serverUrl); void close(); @Override boolean isIdArrayNeeded(); @Override void valuesAdded(DataModelCategory dataModelCategory, long[] ids, Iterable<? extends TileSet> newValues, Object source);  }### Answer:
@Test public void testClose() { EasyMockSupport support = new EasyMockSupport(); List<DataGroupInfo> rootGroups = New.list(); DataRegistry dataRegistry = createDataRegistryForClose(support); DataGroupController groupController = createGroupControllerForClose(support, rootGroups); MantleToolbox mantleBox = createMantleToolbox(support, groupController); Toolbox toolbox = createToolbox(support, dataRegistry, mantleBox); support.replayAll(); STKDataGroupController controller = new STKDataGroupController(toolbox, ourServerName, ourServerUrl); assertEquals(ourServerName, rootGroups.get(0).getDisplayName()); assertFalse(controller.isIdArrayNeeded()); controller.close(); assertTrue(rootGroups.isEmpty()); support.verifyAll(); }