@Test
public void testRemoveHydrogensAndPreserveAtomID() throws InvalidSmilesException {

    String rawMolSmiles = "[H]POOSC(Br)C(Cl)C(F)I";
    SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
    IAtomContainer atomContainer = sp.parseSmiles(rawMolSmiles);
    IAtom beforeAtom = null;
    IAtom afterAtom = null;
    for (IAtom a : atomContainer.atoms()) {
        if (a.getSymbol().equalsIgnoreCase("P")) {
            beforeAtom = a;
            a.setID("TEST");
            break;
        }
    }
    IAtomContainer result = SMSDNormalizer.removeHydrogensAndPreserveAtomID(atomContainer);
    for (IAtom a : result.atoms()) {
        if (a.getSymbol().equalsIgnoreCase("P")) {
            afterAtom = a;
            break;
        }
    }
    assertEquals(afterAtom.getID(), beforeAtom.getID());
}