code: private List<Integer> tryDoubleBondCombinations(IAtomContainer container, int dblBondsAdded, int bondOffSet,
              int doubleBondMax, List<IAtom> atomsInNeedOfFix) {
  
          int offSet = bondOffSet;
          List<Integer> dblBondPositions = null;
  
          while (offSet < container.getBondCount() && dblBondPositions == null) {
              IBond bond = container.getBond(offSet);
              if (atomsInNeedOfFix.contains(bond.getBegin()) && atomsInNeedOfFix.contains(bond.getEnd())) {
                  bond.setOrder(IBond.Order.DOUBLE);
                  dblBondsAdded = dblBondsAdded + 1;
                  if (dblBondsAdded == doubleBondMax) {
                      boolean validDoubleBondConfig = true;
                      CHECK: for (IAtom atom : container.atoms()) {
                          if (atom.getValency() != atom.getImplicitHydrogenCount() + getConnectivity(atom, container)) {
                              validDoubleBondConfig = false;
                              break CHECK;
                          }
                      }
                      if (validDoubleBondConfig) {
                          dblBondPositions = new ArrayList<Integer>();
                          for (int idx = 0; idx < container.getBondCount(); idx++) {
                              if (container.getBond(idx).getOrder().equals(IBond.Order.DOUBLE))
                                  dblBondPositions.add(idx);
                          }
                          return dblBondPositions;
                      }
                  } else {
                      dblBondPositions = tryDoubleBondCombinations(container, dblBondsAdded, offSet + 1, doubleBondMax,
                              atomsInNeedOfFix);
                  }
  
                  bond.setOrder(IBond.Order.SINGLE);
                  dblBondsAdded = dblBondsAdded - 1;
              }
              offSet++;
          }
          return dblBondPositions;
      }
docs: Tries double bond combinations for a certain input container of which the double bonds have been stripped
  around the mobile hydrogen positions. Recursively.
  
  @param container
  @param dblBondsAdded counts double bonds added so far
  @param bondOffSet offset for next double bond position to consider
  @param doubleBondMax maximum number of double bonds to add
  @param atomsInNeedOfFix atoms that require more bonds
  @return a list of double bond positions (index) that make a valid combination, null if none found