### Question:
ArcGISDataGroupProvider { public ArcGISDataGroupInfo getDataGroup(DataModelCategory category) { String startsWithId = category.getCategory().replaceAll("/MapServer.*", ""); Set<DataGroupInfo> found = myDataGroupController.findActiveDataGroupInfo((t) -> test(t, startsWithId), true); ArcGISDataGroupInfo dataGroup = null; if (!found.isEmpty()) { dataGroup = (ArcGISDataGroupInfo)found.iterator().next(); } return dataGroup; } ArcGISDataGroupProvider(DataGroupController dataGroupController); ArcGISDataGroupInfo getDataGroup(DataModelCategory category);  }### Answer:
@Test public void testGetDataGroup() { EasyMockSupport support = new EasyMockSupport(); Toolbox toolbox = createToolbox(support); List<DataGroupInfo> dataGroups = createDataGroups(support, toolbox); ArcGISDataGroupInfo theGroup = new ArcGISDataGroupInfo(toolbox, "The Group", ourGroupId); dataGroups.add(theGroup); DataGroupController dataGroupController = createController(support, dataGroups); support.replayAll(); ArcGISDataGroupProvider provider = new ArcGISDataGroupProvider(dataGroupController); DataModelCategory category = new DataModelCategory(null, null, ourLayer); ArcGISDataGroupInfo found = provider.getDataGroup(category); assertEquals(theGroup, found); support.verifyAll(); }
@Test public void testGetDataGroupNotFound() { EasyMockSupport support = new EasyMockSupport(); Toolbox toolbox = createToolbox(support); List<DataGroupInfo> dataGroups = createDataGroups(support, toolbox); DataGroupController dataGroupController = createController(support, dataGroups); support.replayAll(); ArcGISDataGroupProvider provider = new ArcGISDataGroupProvider(dataGroupController); DataModelCategory category = new DataModelCategory(null, null, ourLayer); ArcGISDataGroupInfo found = provider.getDataGroup(category); assertNull(found); support.verifyAll(); }