### Question:
FeatureDataTypeBuilder implements LayerActivationListener { @Override public void layerDeactivated(GeoPackageDataTypeInfo layer) { myDataTypeController.removeDataType(layer, this); } FeatureDataTypeBuilder(DataTypeController dataTypeController, OrderManagerRegistry orderManagerRegistry,
            MapManager mapManager); void buildDataType(GeoPackageFeatureLayer layer, DefaultDataTypeInfo dataType, String layerId); @Override void layerActivated(GeoPackageDataTypeInfo layer); @Override void layerDeactivated(GeoPackageDataTypeInfo layer);  }### Answer:
@Test public void testTypeDeactivated() { EasyMockSupport support = new EasyMockSupport(); DataTypeController controller = support.createMock(DataTypeController.class); controller.removeDataType(EasyMock.isA(GeoPackageDataTypeInfo.class), EasyMock.isA(FeatureDataTypeBuilder.class)); EasyMock.expectLastCall().andAnswer(() -> { myActualType = (DefaultDataTypeInfo)EasyMock.getCurrentArguments()[0]; return true; }); Toolbox toolbox = createToolbox(support); GeoPackageFeatureLayer layer = new GeoPackageFeatureLayer("package", ourPackageFile, ourLayerName, 10); OrderManagerRegistry orderRegistry = createOrderRegistry(support, false); MapManager manager = support.createMock(MapManager.class); support.replayAll(); GeoPackageDataTypeInfo expectedDataType = new GeoPackageDataTypeInfo(toolbox, layer, ourLayerId); FeatureDataTypeBuilder builder = new FeatureDataTypeBuilder(controller, orderRegistry, manager); builder.layerDeactivated(expectedDataType); assertEquals(expectedDataType, myActualType); support.verifyAll(); }