code: private static IReactionScheme setScheme(IReaction reaction, IReactionSet reactionSet) {
          IReactionScheme reactionScheme = reaction.getBuilder().newInstance(IReactionScheme.class);
  
          IReactionSet reactConSet = extractSubsequentReaction(reaction, reactionSet);
          if (reactConSet.getReactionCount() != 0) {
              for (IReaction reactionInt : reactConSet.reactions()) {
                  reactionScheme.addReaction(reactionInt);
                  IReactionScheme newRScheme = setScheme(reactionInt, reactionSet);
                  if (newRScheme.getReactionCount() != 0 || newRScheme.getReactionSchemeCount() != 0) {
                      reactionScheme.add(newRScheme);
                  }
              }
          }
          return reactionScheme;
      }
docs: Create a IReactionScheme given as a top a IReaction. If it doesn't exist any subsequent reaction
  return null;
  
  @param reaction       The IReaction as a top
  @param reactionSet    The IReactionSet to extract a IReactionScheme
  @return               The IReactionScheme