Mol2Writer extends DefaultChemObjectWriter { @Override public boolean accepts(Class<? extends IChemObject> classObject) { if (IAtomContainer.class.equals(classObject)) return true; Class<?>[] interfaces = classObject.getInterfaces(); for (Class<?> anInterface : interfaces) { if (IAtomContainer.class.equals(anInterface)) return true; } Class superClass = classObject.getSuperclass(); if (superClass != null) return this.accepts(superClass); return false; } Mol2Writer();  Mol2Writer(Writer out);  Mol2Writer(OutputStream output); @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 writeMolecule(IAtomContainer mol);  }
@Test public void testAccepts() throws Exception { Mol2Writer writer = new Mol2Writer(); Assert.assertTrue(writer.accepts(AtomContainer.class)); }