### Question:
FeatureExporter implements GeoPackageSubExporter { @Override public void export(ExportModel model) { for (DataTypeInfo dataType : myDataTypes) { if (isExportable(dataType)) { myLayerExporter.exportFeatures(dataType, model.getGeoPackage(), model.getProgressReporter().getModel(), model.getProgressReporter().getTaskActivity()); } if (model.getProgressReporter().getTaskActivity().isCancelled()) { break; } } } FeatureExporter(Collection<? extends DataTypeInfo> dataTypes, DataElementLookupUtils lookupUtils,
            DataElementCache elementCache); static boolean isExportable(DataTypeInfo dataType); @Override Collection<DataTypeInfo> getExportableTypes(); @Override int getRecordCount(); @Override void export(ExportModel model);  }### Answer:
@Test public void testExportFeatures() throws DataElementLookupException { EasyMockSupport support = new EasyMockSupport(); ProgressReporter reporter = new ProgressReporter(new ProgressModel(), Collections.emptyList(), new CancellableTaskActivity()); DataTypeInfo dataType = createDataType(support); DataElementLookupUtils lookup = createLookupUtils(support, dataType); DataElementCache cache = support.createMock(DataElementCache.class); List<DataTypeInfo> dataTypes = createDataTypes(support, dataType, null); GeoPackage geopackage = createGeoPackage(support); ExportModel exportModel = new ExportModel(null); exportModel.setGeoPackage(geopackage); exportModel.setProgressReporter(reporter); support.replayAll(); FeatureExporter exporter = new FeatureExporter(dataTypes, lookup, cache); exporter.export(exportModel); support.verifyAll(); }
@Test public void testExportFeaturesCancelled() throws DataElementLookupException { EasyMockSupport support = new EasyMockSupport(); ProgressReporter reporter = new ProgressReporter(new ProgressModel(), Collections.emptyList(), new CancellableTaskActivity()); DataTypeInfo dataType = support.createMock(DataTypeInfo.class); DataElementLookupUtils lookup = support.createMock(DataElementLookupUtils.class); DataElementCache cache = support.createMock(DataElementCache.class); List<DataTypeInfo> dataTypes = createDataTypes(support, dataType, reporter.getTaskActivity()); GeoPackage geopackage = support.createMock(GeoPackage.class); ExportModel exportModel = new ExportModel(null); exportModel.setGeoPackage(geopackage); exportModel.setProgressReporter(reporter); support.replayAll(); FeatureExporter exporter = new FeatureExporter(dataTypes, lookup, cache); exporter.export(exportModel); support.verifyAll(); }