### Question:
GeoPackageFeatureLayer extends GeoPackageLayer { public List<Map<String, Serializable>> getData() { return myData; } GeoPackageFeatureLayer(String packageName, String packageFile, String name, int recordCount); List<Map<String, Serializable>> getData();  }### Answer:
@Test public void test() throws IOException, ClassNotFoundException { String packageName = "I am package"; String packageFile = "c:\\somepackage.gpkg"; String name = "MyName"; List<Map<String, Serializable>> rows = createTestData(); GeoPackageFeatureLayer layer = new GeoPackageFeatureLayer(packageName, packageFile, name, rows.size()); layer.getData().addAll(rows); ByteArrayOutputStream out = new ByteArrayOutputStream(); ObjectOutputStream objectOut = new ObjectOutputStream(out); objectOut.writeObject(layer); ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); ObjectInputStream objectIn = new ObjectInputStream(in); GeoPackageFeatureLayer actual = (GeoPackageFeatureLayer)objectIn.readObject(); assertEquals(packageName, actual.getPackageName()); assertEquals(packageFile, actual.getPackageFile()); assertEquals(name, actual.getName()); assertEquals(LayerType.FEATURE, actual.getLayerType()); assertEquals(rows.size(), actual.getRecordCount()); assertEquals(rows, actual.getData()); }