HINReader extends DefaultChemObjectReader { @Override public boolean accepts(Class<? extends IChemObject> classObject) { if (IChemFile.class.equals(classObject)) return true; Class<?>[] interfaces = classObject.getInterfaces(); for (Class<?> anInterface : interfaces) { if (IChemFile.class.equals(anInterface)) return true; } Class superClass = classObject.getSuperclass(); if (superClass != null) return this.accepts(superClass); return false; } HINReader(Reader input);  HINReader(InputStream input);  HINReader(); @Override IResourceFormat getFormat(); @Override void close(); @Override void setReader(Reader input); @Override void setReader(InputStream input); @Override boolean accepts(Class<? extends IChemObject> classObject); @Override T read(T object);  }
@Test public void testAccepts() { Assert.assertTrue(chemObjectIO.accepts(ChemFile.class)); }