### Question:
GeoPackageDataEnsurer { public void ensureData(Set<String> imports) { for (String importFile : imports) { LOGGER.info("Verifying geopackage file is cached for " + importFile); File theFile = new File(importFile); if (theFile.exists()) { DataModelCategory category = new DataModelCategory(importFile, null, null); DefaultQuery layerQuery = new DefaultQuery(category, New.collection()); long[] ids = myRegistry.performLocalQuery(layerQuery); if (ids == null || ids.length <= 0) { LOGGER.info("Could not find geopackage file in cache reimporting " + importFile); myRegistry.removeModels(category, false); myImporter.importFile(theFile, null); } else { LOGGER.info("Geopackage file is cached for " + importFile); } } } } GeoPackageDataEnsurer(FileOrURLImporter importer, DataRegistry registry); void ensureData(Set<String> imports);  }### Answer:
@Test public void testEnsureDataAllThere() throws IOException { EasyMockSupport support = new EasyMockSupport(); File allThere = File.createTempFile("allThere", "." + GeoPackageConstants.GEOPACKAGE_EXTENSION); allThere.deleteOnExit(); File nada = File.createTempFile("nada", "." + GeoPackageConstants.GEOPACKAGE_EXTENSION); nada.deleteOnExit(); File nonExistent = new File( System.getProperty("nonexistentFile", "c:\\nonexistent." + GeoPackageConstants.GEOPACKAGE_EXTENSION)); Set<String> imports = New.set(allThere.toString(), nada.toString(), nonExistent.toString()); FileOrURLImporter importer = createImporter(support, nada); DataRegistry registry = createRegistry(support, allThere, nada); support.replayAll(); GeoPackageDataEnsurer ensurer = new GeoPackageDataEnsurer(importer, registry); ensurer.ensureData(imports); support.verifyAll(); }