### Question:
DatasetFactory implements DatasetFactoryInterface { @Override public Dataset datasetFor(String namespace) throws DatasetRegistryException { Dataset dataset = registry.datasetFor(namespace); DatasetProxy datasetProxy = new DatasetProxy(dataset); try { Pair<URI, JsonNode> jsonNode = configDataset(dataset); datasetProxy.setConfig(jsonNode.getRight()); datasetProxy.setConfigURI(jsonNode.getLeft()); } catch (Throwable ex) { String msg = "failed to configure dataset in namespace [" + namespace + "]"; throw new DatasetRegistryException(dataset == null ? msg : (msg + " with archiveURI [" + dataset.getArchiveURI() + "] and citation [" + dataset.getCitation() + "]"), ex); } return datasetProxy; } DatasetFactory(DatasetRegistry registry);  DatasetFactory(DatasetRegistry registry, InputStreamFactory factory); @Override Dataset datasetFor(String namespace);  }### Answer:
@Test public void createDataset() throws DatasetRegistryException, URISyntaxException { String meta = "jar:" + getClass().getResource("/org/globalbioticinteractions/dataset/archive.zip").toURI().toString() + "!/template-dataset-e68f4487ebc3bc70668c0f738223b92da0598c00/"; Dataset dataset = datasetFor(meta); assertThat(dataset.getCitation(), is("Jorrit H. Poelen. 2014. Species associations manually extracted from literature.")); }
@Test public void createDatasetDWCA() throws DatasetRegistryException, URISyntaxException { String meta = "jar:" + getClass().getResource("/org/globalbioticinteractions/dataset/dwca.zip").toURI().toString() + "!/vampire-moth-dwca-c4549a1690b84595c88946f477057b9ab76e5360"; Dataset dataset = datasetFor(meta); assertThat(dataset.getCitation(), is("Occurrence Records for vampire-moths-and-their-fruit-piercing-relatives. 2018-09-27. South Central California Network - 2ba077c1-aa41-455e-9a84-bccb61a91230.")); }