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