Driver { protected static void writeLabelBindings(File dictOut, ARFFModel arffModel, String delimiter, boolean jsonDictonary) throws IOException { Writer writer = Files.newWriterSupplier(dictOut, Charsets.UTF_8, true).getOutput(); try { if (jsonDictonary) { writeLabelBindingsJSON(writer, arffModel); } else { writeLabelBindings(writer, arffModel, delimiter); } } finally { Closeables.close(writer, false); } } private  Driver(); static void main(String[] args);  }
@Test public void dictionary() throws IOException { ARFFModel model = new MapBackedARFFModel(); ARFFVectorIterableTest.getVectors("sample-dense.arff", model); StringWriter writer = new StringWriter(); Driver.writeLabelBindings(writer, model, ","); String expected = Resources.toString(Resources.getResource("expected-arff-dictionary.csv"), Charsets.UTF_8); assertEquals(expected, writer.toString()); }