### Question:
WFSQueryController implements QueryRegionListener, EventListener<ActiveDataGroupsChangedEvent>, ListDataListener<TimeSpan> { @Override public void queryRegionAdded(QueryRegion region) { Collection<WFSDataType> wfsLayers = CollectionUtilities.filterDowncast(myTypeController.getDataTypeInfo(), WFSDataType.class); for (DataTypeInfo wfsLayer : wfsLayers) { if (wfsLayer.isVisible()) { Collection<? extends TimeSpan> timeSpans = myTimeManager.getLoadTimeSpans(); if (wfsLayer.getTimeExtents() == null || wfsLayer.getTimeExtents().getExtent().isTimeless()) { timeSpans = New.list(TimeSpan.TIMELESS); } myGovernorManager.requestData(new Pair<DataTypeInfo, QueryRegion>(wfsLayer, region), timeSpans); } } } WFSQueryController(Toolbox toolbox); @Override void allQueriesRemoved(boolean animationPlanCancelled); void close(); @Override void elementsAdded(ListDataEvent<TimeSpan> e); @Override void elementsChanged(ListDataEvent<TimeSpan> e); @Override void elementsRemoved(ListDataEvent<TimeSpan> e); @Override void notify(ActiveDataGroupsChangedEvent event); @Override void queryRegionAdded(QueryRegion region); @Override void queryRegionRemoved(QueryRegion region);  }### Answer:
@Test public void testQueryRegionAdded() throws DataElementLookupException, InterruptedException { EasyMockSupport support = new EasyMockSupport(); EventManager eventManager = createEventManager(support); TimeManager timeManager = createTimeManager(support); TimeSpan loadSpan = TimeSpan.get(System.currentTimeMillis() - 10000, System.currentTimeMillis()); CountDownLatch latch = new CountDownLatch(1); DataRegistry dataRegistry = createRegistry(support, New.list(loadSpan), New.list(latch)); QueryRegionManager queryManager = createRegionManager(support); List<DataTypeInfo> dataTypes = createTypes(support, TimeSpan.get(1000, System.currentTimeMillis())); DataTypeInfo wfsType = dataTypes.get(dataTypes.size() - 1); DataTypeController typeController = createTypeControllerRemove(support, dataTypes, wfsType, new long[] { 0, 1 }); List<Long> allIds = New.list(Long.valueOf(0), Long.valueOf(1)); DataElementCache cache = createCache(support, wfsType, allIds, null); List<MapGeometrySupport> geometrySupports = New.list(); List<DataElement> elements = createElements(loadSpan, geometrySupports); DataElementLookupUtils lookupUtils = createLookup(support, wfsType, allIds, elements); MapGeometrySupportConverterRegistry converter = createConverter(support, geometrySupports); MantleToolbox mantle = createMantle(support, queryManager, typeController, cache, lookupUtils, converter); Toolbox toolbox = createToolbox(support, eventManager, timeManager, dataRegistry, mantle); QueryRegion region = createRegion(support); support.replayAll(); timeManager.getLoadTimeSpans().add(loadSpan); WFSQueryController controller = new WFSQueryController(toolbox); myRegionListener.queryRegionAdded(region); assertTrue(latch.await(5, TimeUnit.SECONDS)); controller.close(); assertNull(myEventListener); assertNull(myRegionListener); support.verifyAll(); }