code: public List<TupleTwo<TreeNode, TreeNode>> flattenNodes()
     {
        List<TupleTwo<TreeNode, TreeNode>> list = new ArrayList<>();
        collectNodes(root, null, list);
        return list;
     }
docs: / <returns>The list of nodes in the tree</returns>