SMILESWriter extends DefaultChemObjectWriter { @Override public boolean accepts(Class<? extends IChemObject> classObject) { if (IAtomContainer.class.equals(classObject)) return true; if (IAtomContainerSet.class.equals(classObject)) return true; Class<?>[] interfaces = classObject.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { if (IAtomContainerSet.class.equals(interfaces[i])) return true; if (IAtomContainer.class.equals(interfaces[i])) return true; } Class superClass = classObject.getSuperclass(); if (superClass != null) return this.accepts(superClass); return false; } SMILESWriter(Writer out);  SMILESWriter(OutputStream output);  SMILESWriter();  SMILESWriter(FileOutputStream out); @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); void writeAtomContainerSet(IAtomContainerSet som); void writeAtomContainer(IAtomContainer molecule); void customizeJob();  }
@Test public void testAccepts() throws Exception { SMILESWriter reader = new SMILESWriter(); Assert.assertTrue(reader.accepts(AtomContainer.class)); Assert.assertTrue(reader.accepts(AtomContainerSet.class)); }