code: private void collect(PrintStream out, List<ItemSet> list, TotalSupportTree ttree, int[] itemset, int support) {
          if (list != null) {
              synchronized (list) {
                  list.add(new ItemSet(itemset, support));
              }
          }
          if (out != null) {
              synchronized (out) {
                  for (int i = 0; i < itemset.length; i++) {
                      out.format("%d ", itemset[i]);
                  }
                  out.format("(%d)%n", support);
              }
          }
          if (ttree != null) {
              synchronized (ttree) {
                  ttree.add(itemset, support);
              }
          }
      }
docs: Adds an item set to the result.