### Question:
STKDataGroupActivationListener extends AbstractActivationListener { @Override public void handleCommit(boolean active, DataGroupInfo dgi, PhasedTaskCanceller canceller) { super.handleCommit(active, dgi, canceller); if (active) { handleActivated(dgi); } else { handleDeactivated(dgi); } } STKDataGroupActivationListener(DataRegistry dataRegistry); @Override void handleCommit(boolean active, DataGroupInfo dgi, PhasedTaskCanceller canceller);  }### Answer:
@Test public void testHandleCommitActivated() { EasyMockSupport support = new EasyMockSupport(); DataGroupInfo dataGroup = createDataGroup(support); DataRegistry dataRegistry = support.createMock(DataRegistry.class); EasyMock.expect(dataRegistry.submitQuery(EasyMock.isA(SimpleQuery.class))).andAnswer(this::queryAnswer); support.replayAll(); STKDataGroupActivationListener listener = new STKDataGroupActivationListener(dataRegistry); listener.handleCommit(true, dataGroup, null); support.verifyAll(); }
@Test public void testHandleCommitDeactivated() { EasyMockSupport support = new EasyMockSupport(); DataGroupInfo dataGroup = createDataGroup(support); DataRegistry dataRegistry = support.createMock(DataRegistry.class); EasyMock.expect(dataRegistry.removeModels( EasyMock.eq(new DataModelCategory(ourServerUrl, TileSetMetadata.class.getName(), ourLayerName)), EasyMock.eq(false))).andReturn(new long[] {}); support.replayAll(); STKDataGroupActivationListener listener = new STKDataGroupActivationListener(dataRegistry); listener.handleCommit(false, dataGroup, null); support.verifyAll(); }