CDKOWLWriter extends DefaultChemObjectWriter { private void writeMolecule(IAtomContainer mol) { Model model = Convertor.molecule2Model(mol); model.write(output, "N3"); } CDKOWLWriter(Writer output);  CDKOWLWriter(); @Override IResourceFormat getFormat(); @Override void setWriter(Writer out); @Override void setWriter(OutputStream output); @Override void close(); @Override boolean accepts(Class<? extends IChemObject> classObject); @Override void write(IChemObject object);  }
@Test public void testWriteMolecule() throws Exception { BasicConfigurator.configure(); Logger.getRootLogger().setLevel(Level.ERROR); StringWriter output = new StringWriter(); CDKOWLWriter writer = new CDKOWLWriter(output); IAtomContainer mol = DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class); mol.addAtom(new Atom("C")); mol.addAtom(new Atom("C")); mol.addBond(0, 1, IBond.Order.DOUBLE); writer.write(mol); writer.close(); String outputString = output.toString(); Assert.assertTrue(outputString.contains("http: }