@Test
public void testRemoveMolecule() throws Exception {

    logger.debug("***TestRemoveMolecule***");
    boolean itIsInThere = false;
    TemplateHandler th = new TemplateHandler(DefaultChemObjectBuilder.getInstance());
    IAtomContainer mol = TestMoleculeFactory.makeAlphaPinene();
    sdg.setMolecule(mol);
    sdg.generateCoordinates();
    mol = sdg.getMolecule();
    String smiles = "C1=C(C)C2CC(C1)C2(C)(C)";
    IAtomContainer smilesMol = sp.parseSmiles(smiles);
    itIsInThere = th.mapTemplates(smilesMol);
    logger.debug("Alpha-Pinene found by templateMapper: " + itIsInThere);
    Assert.assertFalse(itIsInThere);
    th.addMolecule(mol);
    logger.debug("now adding template for alpha-Pinen and trying again.");
    itIsInThere = th.mapTemplates(smilesMol);
    logger.debug("Alpha-Pinene found by templateMapper: " + itIsInThere);
    Assert.assertTrue(itIsInThere);
    logger.debug("now removing template for alpha-Pinen again and trying again.");
    th.removeMolecule(mol);
    itIsInThere = th.mapTemplates(smilesMol);
    logger.debug("Alpha-Pinene found by templateMapper: " + itIsInThere);
    Assert.assertFalse(itIsInThere);
}