@Test
public void testPreservingFormalCharge() throws Exception {

    AtomContainer mol = new AtomContainer();
    mol.addAtom(new Atom(Elements.OXYGEN));
    mol.getAtom(0).setFormalCharge(-1);
    mol.addAtom(new Atom(Elements.CARBON));
    mol.addBond(0, 1, IBond.Order.SINGLE);
    addImplicitHydrogens(mol);
    SmilesGenerator generator = new SmilesGenerator();
    generator.create(new AtomContainer(mol));
    Assert.assertEquals(-1, mol.getAtom(0).getFormalCharge().intValue());
    // mmm, that does not reproduce the bug findings yet :(
}