code: public static void main(String[] args)
      {
          System.out.println("fact(5)=" + factorial(5));
          System.out.println("fact(3)=" + factorial(3));
          List<String> list = Arrays.asList("1", "2", "3", "4", "5");
          CombinationGenerator<String> combos = new CombinationGenerator<String>(list, 3);
          int count = 1;
          System.out.println("Total number=" + combos.getTotalNumberOfCombinations());
          for (List<String> combination : combos)
          {
              System.out.println(count + ": " + combination + " {" + combos.indexesAsString + "}");
              count++;
          }
      }
docs: ==================================================