MoSSOutputReader extends DefaultChemObjectReader { @Override public boolean accepts(Class<? extends IChemObject> testClass) { if (IAtomContainerSet.class.equals(testClass)) return true; if (IChemFile.class.equals(testClass)) return true; Class<?>[] interfaces = testClass.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { if (IAtomContainerSet.class.equals(interfaces[i])) return true; if (IChemFile.class.equals(interfaces[i])) return true; } Class superClass = testClass.getSuperclass(); if (superClass != null) return this.accepts(superClass); return false; } MoSSOutputReader(Reader input);  MoSSOutputReader(InputStream input);  MoSSOutputReader(); @Override IResourceFormat getFormat(); @Override void setReader(Reader reader); @Override void setReader(InputStream input); @Override boolean accepts(Class<? extends IChemObject> testClass); @Override T read(T object); @Override void close();  }
@Test public void testAccepts() { MoSSOutputReader reader = new MoSSOutputReader(); Assert.assertTrue(reader.accepts(AtomContainerSet.class)); }