@Test
public void testEthylbenzaldehydeMapping() throws Exception {

    IReactionProcess type = new HomolyticCleavageReaction();
    IAtomContainerSet setOfReactants = builder.newInstance(IAtomContainerSet.class);
    //smiles("CCc1ccc(C=O)cc1")
    IAtomContainer molecule = builder.newInstance(IAtomContainer.class);
    molecule.addAtom(builder.newInstance(IAtom.class, "C"));
    molecule.addAtom(builder.newInstance(IAtom.class, "C"));
    molecule.addBond(0, 1, IBond.Order.SINGLE);
    molecule.addAtom(builder.newInstance(IAtom.class, "C"));
    molecule.addBond(1, 2, IBond.Order.SINGLE);
    molecule.addAtom(builder.newInstance(IAtom.class, "C"));
    molecule.addBond(2, 3, IBond.Order.SINGLE);
    molecule.addAtom(builder.newInstance(IAtom.class, "C"));
    molecule.addBond(3, 4, IBond.Order.DOUBLE);
    molecule.addAtom(builder.newInstance(IAtom.class, "C"));
    molecule.addBond(4, 5, IBond.Order.SINGLE);
    molecule.addAtom(builder.newInstance(IAtom.class, "C"));
    molecule.addBond(5, 6, IBond.Order.SINGLE);
    molecule.addAtom(builder.newInstance(IAtom.class, "O"));
    molecule.addBond(6, 7, IBond.Order.DOUBLE);
    molecule.addAtom(builder.newInstance(IAtom.class, "C"));
    molecule.addBond(5, 8, IBond.Order.DOUBLE);
    molecule.addAtom(builder.newInstance(IAtom.class, "C"));
    molecule.addBond(8, 9, IBond.Order.SINGLE);
    molecule.addBond(9, 2, IBond.Order.DOUBLE);
    addExplicitHydrogens(molecule);
    AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
    LonePairElectronChecker lpcheck = new LonePairElectronChecker();
    lpcheck.saturate(molecule);
    molecule.getAtom(0).setFlag(CDKConstants.REACTIVE_CENTER, true);
    molecule.getAtom(1).setFlag(CDKConstants.REACTIVE_CENTER, true);
    molecule.getAtom(2).setFlag(CDKConstants.REACTIVE_CENTER, true);
    molecule.getBond(0).setFlag(CDKConstants.REACTIVE_CENTER, true);
    molecule.getBond(1).setFlag(CDKConstants.REACTIVE_CENTER, true);
    setOfReactants.addAtomContainer(molecule);
    /* has active center */
    List<IParameterReact> paramList = new ArrayList<IParameterReact>();
    IParameterReact param = new SetReactionCenter();
    param.setParameter(Boolean.TRUE);
    paramList.add(param);
    type.setParameterList(paramList);
    /* initiate */
    makeSureAtomTypesAreRecognized(molecule);
    IReactionSet setOfReactions = type.initiate(setOfReactants, null);
    IAtomContainer product11 = setOfReactions.getReaction(0).getProducts().getAtomContainer(0);
    IAtomContainer product12 = setOfReactions.getReaction(0).getProducts().getAtomContainer(1);
    Assert.assertEquals(20, setOfReactions.getReaction(0).getMappingCount());
    IAtom mappedProductA1 = (IAtom) ReactionManipulator.getMappedChemObject(setOfReactions.getReaction(0),
            molecule.getAtom(0));
    Assert.assertEquals(mappedProductA1, product11.getAtom(0));
    IAtom mappedProductA2 = (IAtom) ReactionManipulator.getMappedChemObject(setOfReactions.getReaction(0),
            molecule.getAtom(1));
    Assert.assertEquals(mappedProductA2, product12.getAtom(0));
    IAtomContainer product21 = setOfReactions.getReaction(1).getProducts().getAtomContainer(0);
    IAtomContainer product22 = setOfReactions.getReaction(1).getProducts().getAtomContainer(1);
    Assert.assertEquals(20, setOfReactions.getReaction(0).getMappingCount());
    mappedProductA1 = (IAtom) ReactionManipulator.getMappedChemObject(setOfReactions.getReaction(1),
            molecule.getAtom(1));
    Assert.assertEquals(mappedProductA1, product21.getAtom(1));
    mappedProductA2 = (IAtom) ReactionManipulator.getMappedChemObject(setOfReactions.getReaction(1),
            molecule.getAtom(2));
    Assert.assertEquals(mappedProductA2, product22.getAtom(0));
}