docs: public static void iterate(int dimension, int n, int[] size, int[] res, int dimension2, int n2, int[] size2,
                                 int[] res2, CoordinateFunction func) {
          if (dimension >= n || dimension2 >= n2) {
              // stop clause
              func.process(ArrayUtil.toLongArray(res), ArrayUtil.toLongArray(res2));
              return;
          }
  
          if (size2.length != size.length) {
              if (dimension >= size.length)
                  return;
              for (int i = 0; i < size[dimension]; i++) {
                  if (dimension2 >= size2.length)
                      break;
                  for (int j = 0; j < size2[dimension2]; j++) {
                      res[dimension] = i;
                      res2[dimension2] = j;
                      iterate(dimension + 1, n, size, res, dimension2 + 1, n2, size2, res2, func);
                  }
  
              }
          } else {
              if (dimension >= size.length)
                  return;
  
              for (int i = 0; i < size[dimension]; i++) {
                  for (int j = 0; j < size2[dimension2]; j++) {
                      if (dimension2 >= size2.length)
                          break;
                      res[dimension] = i;
                      res2[dimension2] = j;
                      iterate(dimension + 1, n, size, res, dimension2 + 1, n2, size2, res2, func);
                  }
  
              }
          }
      }