test_class.declarator: lpcheck = new LonePairElectronChecker()
test_class.modifier: private final
test_class.original_string: private final LonePairElectronChecker lpcheck = new LonePairElectronChecker();
test_class.type: LonePairElectronChecker
test_class.var_name: lpcheck
test_class.declarator: builder = SilentChemObjectBuilder.getInstance()
test_class.modifier: private
test_class.original_string: private IChemObjectBuilder            builder = SilentChemObjectBuilder.getInstance();
test_class.type: IChemObjectBuilder
test_class.var_name: builder
test_class.declarator: uiTester
test_class.modifier: private
test_class.original_string: private UniversalIsomorphismTester    uiTester;
test_class.type: UniversalIsomorphismTester
test_class.var_name: uiTester
test_class.file: base/reaction/src/test/java/org/openscience/cdk/reaction/type/AdductionProtonLPReactionTest.java
test_class.identifier: AdductionProtonLPReactionTest
test_class.superclass: extends ReactionProcessTest
test_case.body: @Test
      public void testCDKConstants_REACTIVE_CENTER() throws Exception {
          IReactionProcess type = new AdductionProtonLPReaction();
          IAtomContainerSet setOfReactants = getExampleReactants();
  
          /* manually putting the active center */
          IAtomContainer molecule = setOfReactants.getAtomContainer(0);
          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.getAtom(4).setFlag(CDKConstants.REACTIVE_CENTER, true);
          molecule.getBond(0).setFlag(CDKConstants.REACTIVE_CENTER, true);
          molecule.getBond(1).setFlag(CDKConstants.REACTIVE_CENTER, true);
          molecule.getBond(3).setFlag(CDKConstants.REACTIVE_CENTER, true);
  
          List<IParameterReact> paramList = new ArrayList<IParameterReact>();
          IParameterReact param = new SetReactionCenter();
          param.setParameter(Boolean.TRUE);
          paramList.add(param);
          type.setParameterList(paramList);
          /* initiate */
          IReactionSet setOfReactions = type.initiate(setOfReactants, null);
  
          IAtomContainer reactant = setOfReactions.getReaction(0).getReactants().getAtomContainer(0);
          Assert.assertTrue(molecule.getAtom(0).getFlag(CDKConstants.REACTIVE_CENTER));
          Assert.assertTrue(reactant.getAtom(0).getFlag(CDKConstants.REACTIVE_CENTER));
          Assert.assertTrue(molecule.getAtom(1).getFlag(CDKConstants.REACTIVE_CENTER));
          Assert.assertTrue(reactant.getAtom(1).getFlag(CDKConstants.REACTIVE_CENTER));
          Assert.assertTrue(molecule.getAtom(2).getFlag(CDKConstants.REACTIVE_CENTER));
          Assert.assertTrue(reactant.getAtom(2).getFlag(CDKConstants.REACTIVE_CENTER));
          Assert.assertTrue(molecule.getAtom(4).getFlag(CDKConstants.REACTIVE_CENTER));
          Assert.assertTrue(reactant.getAtom(4).getFlag(CDKConstants.REACTIVE_CENTER));
          Assert.assertTrue(molecule.getBond(0).getFlag(CDKConstants.REACTIVE_CENTER));
          Assert.assertTrue(reactant.getBond(0).getFlag(CDKConstants.REACTIVE_CENTER));
          Assert.assertTrue(molecule.getBond(1).getFlag(CDKConstants.REACTIVE_CENTER));
          Assert.assertTrue(reactant.getBond(1).getFlag(CDKConstants.REACTIVE_CENTER));
          Assert.assertTrue(molecule.getBond(3).getFlag(CDKConstants.REACTIVE_CENTER));
          Assert.assertTrue(reactant.getBond(3).getFlag(CDKConstants.REACTIVE_CENTER));
      }
test_case.class_method_signature: AdductionProtonLPReactionTest.testCDKConstants_REACTIVE_CENTER()
test_case.full_signature: @Test public void testCDKConstants_REACTIVE_CENTER()
test_case.identifier: testCDKConstants_REACTIVE_CENTER
test_case.invocations: getExampleReactants getAtomContainer setFlag getAtom setFlag getAtom setFlag getAtom setFlag getAtom setFlag getBond setFlag getBond setFlag getBond setParameter add setParameterList initiate getAtomContainer getReactants getReaction assertTrue getFlag getAtom assertTrue getFlag getAtom assertTrue getFlag getAtom assertTrue getFlag getAtom assertTrue getFlag getAtom assertTrue getFlag getAtom assertTrue getFlag getAtom assertTrue getFlag getAtom assertTrue getFlag getBond assertTrue getFlag getBond assertTrue getFlag getBond assertTrue getFlag getBond assertTrue getFlag getBond assertTrue getFlag getBond
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCDKConstants_REACTIVE_CENTER()
focal_class.declarator: logger = LoggingToolFactory.createLoggingTool(AdductionProtonLPReaction.class)
focal_class.modifier: private static
focal_class.original_string: private static ILoggingTool logger = LoggingToolFactory.createLoggingTool(AdductionProtonLPReaction.class);
focal_class.type: ILoggingTool
focal_class.var_name: logger
focal_class.file: base/reaction/src/main/java/org/openscience/cdk/reaction/type/AdductionProtonLPReaction.java
focal_class.identifier: AdductionProtonLPReaction
focal_class.interfaces: implements IReactionProcess
focal_class.class_method_signature: AdductionProtonLPReaction.AdductionProtonLPReaction()
focal_class.full_signature: public  AdductionProtonLPReaction()
focal_class.identifier: AdductionProtonLPReaction
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  AdductionProtonLPReaction()
focal_class.class_method_signature: AdductionProtonLPReaction.getSpecification()
focal_class.full_signature: @Override public ReactionSpecification getSpecification()
focal_class.identifier: getSpecification
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: ReactionSpecification
focal_class.signature: ReactionSpecification getSpecification()
focal_class.class_method_signature: AdductionProtonLPReaction.initiate(IAtomContainerSet reactants, IAtomContainerSet agents)
focal_class.full_signature: @Override public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents)
focal_class.identifier: initiate
focal_class.modifiers: @Override public
focal_class.parameters: (IAtomContainerSet reactants, IAtomContainerSet agents)
focal_class.return: IReactionSet
focal_class.signature: IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents)
focal_class.class_method_signature: AdductionProtonLPReaction.setActiveCenters(IAtomContainer reactant)
focal_class.full_signature: private void setActiveCenters(IAtomContainer reactant)
focal_class.identifier: setActiveCenters
focal_class.modifiers: private
focal_class.parameters: (IAtomContainer reactant)
focal_class.return: void
focal_class.signature: void setActiveCenters(IAtomContainer reactant)
focal_class.superclass: extends ReactionEngine
focal_method.body: @Override
      public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents) throws CDKException {
  
          logger.debug("initiate reaction: AdductionProtonLPReaction");
  
          if (reactants.getAtomContainerCount() != 1) {
              throw new CDKException("AdductionProtonLPReaction only expects one reactant");
          }
          if (agents != null) {
              throw new CDKException("AdductionProtonLPReaction don't expects agents");
          }
  
          IReactionSet setOfReactions = reactants.getBuilder().newInstance(IReactionSet.class);
          IAtomContainer reactant = reactants.getAtomContainer(0);
  
          IParameterReact ipr = super.getParameterClass(SetReactionCenter.class);
          if (ipr != null && !ipr.isSetParameter()) setActiveCenters(reactant);
  
          if (AtomContainerManipulator.getTotalCharge(reactant) > 0) return setOfReactions;
  
          Iterator<IAtom> atoms = reactant.atoms().iterator();
          while (atoms.hasNext()) {
              IAtom atomi = atoms.next(); // Atom pos 1
              if (atomi.getFlag(CDKConstants.REACTIVE_CENTER)
                      && (atomi.getFormalCharge() == CDKConstants.UNSET ? 0 : atomi.getFormalCharge()) <= 0
                      && reactant.getConnectedLonePairsCount(atomi) > 0
                      && reactant.getConnectedSingleElectronsCount(atomi) == 0) {
  
                  ArrayList<IAtom> atomList = new ArrayList<IAtom>();
                  atomList.add(atomi);
                  IAtom atomH = reactant.getBuilder().newInstance(IAtom.class, "H");
                  atomH.setFormalCharge(1);
                  atomList.add(atomH);
  
                  IAtomContainerSet moleculeSet = reactant.getBuilder().newInstance(IAtomContainerSet.class);
                  moleculeSet.addAtomContainer(reactant);
                  IAtomContainer adduct = reactant.getBuilder().newInstance(IAtomContainer.class);
                  adduct.addAtom(atomH);
                  moleculeSet.addAtomContainer(adduct);
  
                  IReaction reaction = mechanism.initiate(moleculeSet, atomList, null);
                  if (reaction == null)
                      continue;
                  else
                      setOfReactions.addReaction(reaction);
  
              }
          }
  
          return setOfReactions;
      }
focal_method.class_method_signature: AdductionProtonLPReaction.initiate(IAtomContainerSet reactants, IAtomContainerSet agents)
focal_method.full_signature: @Override public IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents)
focal_method.identifier: initiate
focal_method.invocations: debug getAtomContainerCount newInstance getBuilder getAtomContainer getParameterClass isSetParameter setActiveCenters getTotalCharge iterator atoms hasNext next getFlag getFormalCharge getFormalCharge getConnectedLonePairsCount getConnectedSingleElectronsCount add newInstance getBuilder setFormalCharge add newInstance getBuilder addAtomContainer newInstance getBuilder addAtom addAtomContainer initiate addReaction
focal_method.modifiers: @Override public
focal_method.parameters: (IAtomContainerSet reactants, IAtomContainerSet agents)
focal_method.return: IReactionSet
focal_method.signature: IReactionSet initiate(IAtomContainerSet reactants, IAtomContainerSet agents)