### Question:
TableImporter { public List<Map<String, Serializable>> importFeatures(FeatureDao dao, CancellableTaskActivity ta, ProgressModel model) { List<Map<String, Serializable>> importedTable = New.list(); FeatureResultSet resultSet = dao.queryForAll(); ProjectionTransform toGeodetic = dao.getProjection().getTransformation(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM); while (resultSet.moveToNext() && !ta.isCancelled()) { FeatureRow row = resultSet.getRow(); Map<String, Serializable> importedRow = myRowImporter.importRow(row, toGeodetic); importedTable.add(importedRow); model.setCompletedCount(model.getCompletedCount() + 1); } return importedTable; }  List<Map<String, Serializable>> importFeatures(FeatureDao dao, CancellableTaskActivity ta, ProgressModel model);  }### Answer:
@Test public void testImportFeatures() { EasyMockSupport support = new EasyMockSupport(); CancellableTaskActivity ta = new CancellableTaskActivity(); MockFeatureDao dao = createTestData(support, null); ProgressModel model = new ProgressModel(); support.replayAll(); TableImporter importer = new TableImporter(); List<Map<String, Serializable>> importedRows = importer.importFeatures(dao, ta, model); assertEquals(3, model.getCompletedCount()); assertEquals(3, importedRows.size()); int index = 0; for (Map<String, Serializable> row : importedRows) { assertEquals(4, row.size()); assertEquals("value" + index, row.get("column1")); assertEquals(10 + index, row.get("column2")); assertEquals(54.3 + index, row.get("column3")); Point actualLocation = (Point)row.get(GeoPackageColumns.GEOMETRY_COLUMN); assertEquals(actualLocation.getCoordinate().x, 5 + index, 0d); assertEquals(actualLocation.getCoordinate().y, 6 + index, 0d); index++; } support.verifyAll(); }
@Test public void testImportFeaturesCancel() { EasyMockSupport support = new EasyMockSupport(); CancellableTaskActivity ta = new CancellableTaskActivity(); MockFeatureDao dao = createTestData(support, ta); ProgressModel model = new ProgressModel(); support.replayAll(); TableImporter importer = new TableImporter(); List<Map<String, Serializable>> importedRows = importer.importFeatures(dao, ta, model); assertEquals(1, model.getCompletedCount()); assertEquals(1, importedRows.size()); int index = 0; for (Map<String, Serializable> row : importedRows) { assertEquals(4, row.size()); assertEquals("value" + index, row.get("column1")); assertEquals(10 + index, row.get("column2")); assertEquals(54.3 + index, row.get("column3")); Point actualLocation = (Point)row.get(GeoPackageColumns.GEOMETRY_COLUMN); assertEquals(actualLocation.getCoordinate().x, 5 + index, 0d); assertEquals(actualLocation.getCoordinate().y, 6 + index, 0d); index++; } support.verifyAll(); }