### Question:
NTFileStorage extends TripleBasedStorage { @Override public void commit() { try (OutputStream os = new FileOutputStream(file.toString(), true)) { RDFDataMgr.write(os, metricResults, RDFFormat.NTRIPLES); metricResults.removeAll(); } catch (IOException e) { LOGGER.error("Could not commit to NTFileStorage.", e); } } NTFileStorage();  NTFileStorage(String fileName); @Override void commit(); @Override String toString(); String getFileName();  }### Answer:
@Test public void dataTest() throws IOException{ Storage store = new NTFileStorage("results_test2.nt"); new File("results_test2.nt").delete(); Model m = ModelFactory.createDefaultModel(); m.read(new FileReader("src/test/resources/nt/results_test1.nt"), null, "N-TRIPLE"); store.addData(m); store.commit(); assertEqual("results_test2.nt","src/test/resources/nt/results_test1.nt", true); new File("results_test2.nt").delete(); }
@Test public void metaTest() throws IOException{ Storage store = new NTFileStorage("results_test.nt"); new File("results_test.nt").delete(); Properties extraMeta = new Properties(); extraMeta.setProperty("a", "b"); Properties p = new Properties(); p.put(COMMON.EXPERIMENT_TASK_ID_KEY, "1/1/1"); p.setProperty(COMMON.EXPERIMENT_ID_KEY, "1/1"); p.setProperty(COMMON.CONNECTION_ID_KEY, "virtuoso"); p.setProperty(COMMON.SUITE_ID_KEY, "1"); p.setProperty(COMMON.DATASET_ID_KEY, "dbpedia"); p.put(COMMON.RECEIVE_DATA_START_KEY, "true"); p.put(COMMON.EXPERIMENT_TASK_CLASS_ID_KEY, "ClassName"); p.put(COMMON.EXTRA_META_KEY, new Properties()); p.put(COMMON.NO_OF_QUERIES, 2); store.addMetaData(p); store.commit(); assertEqual("results_test.nt", "src/test/resources/nt/nt_results_woMeta.nt", false); new File("results_test.nt").delete(); store = new NTFileStorage("results_test2.nt"); p.put(COMMON.EXTRA_META_KEY, extraMeta); store.addMetaData(p); store.commit(); assertEqual("results_test2.nt", "src/test/resources/nt/nt_results_wMeta.nt", false); new File("results_test.nt2").delete(); }