MDLV2000Reader extends DefaultChemObjectReader { @SuppressWarnings("unchecked") @Override public boolean accepts(Class<? extends IChemObject> classObject) { Class<?>[] interfaces = classObject.getInterfaces(); for (Class<?> anInterface : interfaces) { if (IChemFile.class.equals(anInterface)) return true; if (IChemModel.class.equals(anInterface)) return true; if (IAtomContainer.class.equals(anInterface)) return true; } if (IAtomContainer.class.equals(classObject)) return true; if (IChemFile.class.equals(classObject)) return true; if (IChemModel.class.equals(classObject)) return true; Class superClass = classObject.getSuperclass(); return superClass != null && this.accepts(superClass); } MDLV2000Reader();  MDLV2000Reader(InputStream in);  MDLV2000Reader(InputStream in, Mode mode);  MDLV2000Reader(Reader in);  MDLV2000Reader(Reader in, Mode mode); @Override IResourceFormat getFormat(); @Override void setReader(Reader input); @Override void setReader(InputStream input); @SuppressWarnings("unchecked") @Override boolean accepts(Class<? extends IChemObject> classObject); @SuppressWarnings("unchecked") @Override T read(T object); @Override void close(); void customizeJob();  }
@Test public void testAccepts() { MDLV2000Reader reader = new MDLV2000Reader(); assertTrue(reader.accepts(ChemFile.class)); assertTrue(reader.accepts(ChemModel.class)); assertTrue(reader.accepts(AtomContainer.class)); }