code: private static boolean incrementLexicographically(
          MutableIntTuple current, IntTuple min, IntTuple max, int index)
      {
          if (index == -1)
          {
              return false;
          }
          int oldValue = current.get(index);
          int newValue = oldValue + 1;
          current.set(index, newValue);
          if (newValue >= max.get(index))
          {
              current.set(index, min.get(index));
              return incrementLexicographically(current, min, max, index-1);
          }
          return true;
      }
docs: Recursively increment the given tuple lexicographically, starting at
  the given index.
  
  @param current The tuple to increment
  @param min The minimum values
  @param max The maximum values
  @param index The index
  @return Whether the tuple could be incremented