class SharingAnionReaction extends ReactionEngine implements IReactionProcess {

    @Override
    public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents) throws CDKException {

        logger.debug("initiate reaction: SharingAnionReaction");

        if (reactants.getAtomContainerCount() != 1) {
            throw new CDKException("SharingAnionReaction only expects one reactant");
        }
        if (agents != null) {
            throw new CDKException("SharingAnionReaction don't expects agents");
        }

        IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
        IAtomContainer reactant = reactants.getAtomContainer(0);
        /*
         * if the parameter hasActiveCenter is not fixed yet, set the active
         * centers
         */
        IParameterReact ipr = super.getParameterClass(SetReactionCenter.class);
        if (ipr != null && !ipr.isSetParameter()) setActiveCenters(reactant);

        Iterator<IAtom> atomis = reactant.atoms().iterator();
        while (atomis.hasNext()) {
            IAtom atomi = atomis.next();
            if (atomi.getFlag(CDKConstants.REACTIVE_CENTER) && atomi.getFormalCharge() == -1
                    && reactant.getConnectedSingleElectronsCount(atomi) == 0
                    && reactant.getConnectedLonePairsList(atomi).size() > 0) {

                Iterator<IBond> bondis = reactant.getConnectedBondsList(atomi).iterator();
                while (bondis.hasNext()) {
                    IBond bondi = bondis.next();
                    if (bondi.getFlag(CDKConstants.REACTIVE_CENTER) && bondi.getOrder() == IBond.Order.SINGLE) {
                        IAtom atomj = bondi.getOther(atomi);
                        if (atomj.getFlag(CDKConstants.REACTIVE_CENTER) && atomj.getFormalCharge() == 1
                                && reactant.getConnectedSingleElectronsCount(atomj) == 0) {

                            ArrayList<IAtom> atomList = new ArrayList<IAtom>();
                            atomList.add(atomi);
                            atomList.add(atomj);
                            ArrayList<IBond> bondList = new ArrayList<IBond>();
                            bondList.add(bondi);

                            IAtomContainerSet moleculeSet = reactant.getBuilder().newInstance(IAtomContainerSet.class);
                            moleculeSet.addAtomContainer(reactant);
                            IReaction reaction = mechanism.initiate(moleculeSet, atomList, bondList);
                            if (reaction == null)
                                continue;
                            else
                                setOfReactions.addReaction(reaction);
                        }
                    }
                }
            }
        }

        return setOfReactions;

    }

    public  SharingAnionReaction();

}