code: public static Collection<Tuple> getTuples( List<VarDef> varDefs, int tupleSize)
      {
      if( tupleSize < 1)
        {
        tupleSize = varDefs.size();
        }
      int varEnd = varDefs.size() - tupleSize + 1;
      if( varEnd <= 0)
        {
        throw new IllegalArgumentException( "Can't create " + tupleSize + "-tuples for " + varDefs.size() + " combined variables");
        }
      return getTuples( varDefs, 0, varEnd, tupleSize);
      }
docs: Returns all valid N-tuples of values for the given input variables. A non-positive tupleSize specifies
  all permutations.