code: public static IAtomContainer toMolecule(IReaction rxn) {
          if (rxn == null)
              throw new IllegalArgumentException("Null reaction provided");
          final IChemObjectBuilder bldr = rxn.getBuilder();
          final IAtomContainer mol = bldr.newInstance(IAtomContainer.class);
          mol.setProperties(rxn.getProperties());
          mol.setID(rxn.getID());
          int grpId = 0;
          for (IAtomContainer comp : rxn.getReactants().atomContainers()) {
              assignRoleAndGrp(comp, ReactionRole.Reactant, ++grpId);
              mol.add(comp);
          }
          for (IAtomContainer comp : rxn.getAgents().atomContainers()) {
              assignRoleAndGrp(comp, ReactionRole.Agent, ++grpId);
              mol.add(comp);
          }
          for (IAtomContainer comp : rxn.getProducts().atomContainers()) {
              assignRoleAndGrp(comp, ReactionRole.Product, ++grpId);
              mol.add(comp);
          }
          return mol;
      }
docs: <p>Converts a reaction to an 'inlined' reaction stored as a molecule. All
  reactants, agents, products are added to the molecule as disconnected
  components with atoms flagged as to their role {@link ReactionRole} and
  component group.</p>
  <p>
  The inlined reaction, stored in a molecule can be converted back to an explicit
  reaction with {@link #toReaction}. Data stored on the individual components (e.g.
  titles is lost in the conversion).
  </p>
  
  @param rxn reaction to convert
  @return inlined reaction stored in a molecule
  @see #toReaction