Implementing the permutations() method. Added TreeNodeTest.