@Test
public void testReadGzWithGzipDetection() throws Exception {

    String filename = "data/xyz/bf3.xyz.gz";
    InputStream input = this.getClass().getClassLoader().getResourceAsStream(filename);
    // ok, if format ok, try instantiating a reader
    ISimpleChemObjectReader reader = factory.createReader(input);
    Assert.assertNotNull(reader);
    Assert.assertEquals(((IChemFormat) XYZFormat.getInstance()).getReaderClassName(), reader.getClass().getName());
    // now try reading something from it
    IChemFile chemFile = (IChemFile) reader.read(new ChemFile());
    IAtomContainer molecule = new AtomContainer();
    for (IAtomContainer container : ChemFileManipulator.getAllAtomContainers(chemFile)) {
        molecule.add(container);
    }
    Assert.assertNotNull(molecule);
    Assert.assertEquals(4, molecule.getAtomCount());
}