code: private void moveIndexesToNextCombination()
      {
          for (int i = currentIndexes.length - 1, j = list.size() - 1; i >= 0; i--, j--)
          {
              if (currentIndexes[i] != j)
              {
                  currentIndexes[i]++;
                  for (int k = i + 1; k < currentIndexes.length; k++)
                  {
                      currentIndexes[k] = currentIndexes[k - 1] + 1;
                  }
                  return;
              }
          }
          // otherwise, we are all done:
          currentIndexes = null;
      }
docs: ==================================================