RGroupQueryWriter extends DefaultChemObjectWriter { @SuppressWarnings("unchecked") @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; } RGroupQueryWriter(Writer out);  RGroupQueryWriter(); @SuppressWarnings("unchecked") @Override boolean accepts(Class<? extends IChemObject> classObject); @Override void close(); @Override IResourceFormat getFormat(); @Override void setWriter(OutputStream output); @Override void setWriter(Writer out); @Override void write(IChemObject object);  }
@Test @Override public void testAcceptsAtLeastOneChemObjectClass() { new RGroupQueryWriter().accepts(RGroupQuery.class); }