CDKSourceCodeWriter extends DefaultChemObjectWriter { @Override public boolean accepts(Class<? extends IChemObject> classObject) { Class<?>[] interfaces = classObject.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { if (IAtomContainer.class.equals(interfaces[i])) return true; } if (IAtomContainer.class.equals(classObject)) return true; Class superClass = classObject.getSuperclass(); if (superClass != null) return this.accepts(superClass); return false; } CDKSourceCodeWriter(Writer out);  CDKSourceCodeWriter(OutputStream out);  CDKSourceCodeWriter(); @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); int getSupportedDataFeatures(); int getRequiredDataFeatures();  }
@Test public void testAccepts() throws Exception { Assert.assertTrue(chemObjectIO.accepts(AtomContainer.class)); }