code: private static ArrayList<List<JoinNode>> generateJoinOrders(List<JoinNode> subTrees) {
          ArrayList<List<JoinNode>> permutations = new ArrayList<>();
          for (JoinNode subTree : subTrees) {
              permutations.add(generateJoinOrdersForTree(subTree));
          }
          return permutations;
      }
docs: For each join tree from the input list generate a set of the join trees by permuting the leafs
  (table nodes) of the tree without breaking the joins semantic.
  
  @param subTrees the list of join trees.
  @return The list containing the list of trees of all possible permutations of the input trees