### Question:
WFSGovernor extends TimeSpanGovernor implements QueryTrackerListener { @Override protected boolean performRequest(List<? extends TimeSpan> spans) { DataModelCategory category = new DataModelCategory(null, MapDataElement.class.getName(), myWfsLayer.getTypeKey()); GeneralIntervalPropertyMatcher<DataFilter> filter = null; if (myRegion.getTypeKeyToFilterMap().get(myWfsLayer.getTypeKey()) != null) { filter = new GeneralIntervalPropertyMatcher<>(WFSDataRegistryHelper.DATA_FILTER_PROPERTY_DESCRIPTOR, myRegion.getTypeKeyToFilterMap().get(myWfsLayer.getTypeKey())); } for (Polygon poly : JTSCoreGeometryUtilities.convertToJTSPolygonsAndSplit(myRegion.getGeometries())) { GeometryMatcher geometry = new GeometryMatcher(GeometryAccessor.GEOMETRY_PROPERTY_NAME, GeometryMatcher.OperatorType.INTERSECTS, poly); for (TimeSpan span : spans) { TimeSpan toUse = span; if (span.equals(ourAllTime)) { toUse = TimeSpan.TIMELESS; } TimeSpanMatcher time = new TimeSpanMatcher(TimeSpanAccessor.TIME_PROPERTY_NAME, toUse); List<PropertyMatcher<?>> matchers = New.list(geometry, time); if (filter != null) { matchers.add(filter); } DefaultQuery query = new DefaultQuery(category, Collections.emptyList(), matchers, null); QueryTracker tracker = myDataRegistry.submitQuery(query); tracker.addListener(this); } } return true; } WFSGovernor(MantleToolbox mantle, DataRegistry dataRegistry, DataTypeInfo wfsLayer, QueryRegion region); @Override void clearData(); @Override void clearData(Collection<? extends TimeSpan> spans); @Override void fractionCompleteChanged(QueryTracker tracker, float fractionComplete); @Override void statusChanged(QueryTracker tracker, QueryStatus status);  }### Answer:
@Test public void testQueryRegion() { EasyMockSupport support = new EasyMockSupport(); DataTypeInfo layer = createLayer(support); TimeSpan span = TimeSpan.get(System.currentTimeMillis() - 10000, System.currentTimeMillis()); DataRegistry registry = createRegistry(support, null, span); QueryRegion region = createRegion(support, null); MantleToolbox mantle = support.createNiceMock(MantleToolbox.class); support.replayAll(); WFSGovernor governor = new WFSGovernor(mantle, registry, layer, region); assertTrue(governor.performRequest(New.list(span))); support.verifyAll(); }
@Test public void testQueryRegionFilter() { EasyMockSupport support = new EasyMockSupport(); DataFilter filter = createFilter(support); DataTypeInfo layer = createLayer(support); TimeSpan span = TimeSpan.get(System.currentTimeMillis() - 10000, System.currentTimeMillis()); DataRegistry registry = createRegistry(support, filter, span); QueryRegion region = createRegion(support, filter); MantleToolbox mantle = support.createNiceMock(MantleToolbox.class); support.replayAll(); WFSGovernor governor = new WFSGovernor(mantle, registry, layer, region); assertTrue(governor.performRequest(New.list(span))); support.verifyAll(); }