Mopac7Reader extends DefaultChemObjectReader { @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; } Mopac7Reader(Reader input);  Mopac7Reader(InputStream input);  Mopac7Reader(); @Override /** {@inheritDoc} */ T read(T object); @Override /** {@inheritDoc} */ void setReader(Reader input); @Override /** {@inheritDoc} */ void setReader(InputStream input); @Override /** {@inheritDoc} */ void close(); @Override /** {@inheritDoc} */ boolean accepts(Class<? extends IChemObject> classObject); @Override /** {@inheritDoc} */ IResourceFormat getFormat();  }
@Test public void testAccepts() { Mopac7Reader reader = new Mopac7Reader(); reader.setReaderMode(Mode.STRICT); Assert.assertTrue(reader.accepts(AtomContainer.class)); }