@Test public void shouldReturnOneElementWithJustOneNodeIfTheTreeContainsJustOneElement() { BinaryNode<Integer> root = new BinaryNode<Integer>(1); List<List<BinaryNode>> paths = pathToEveryLeaf.calculate(root); assertEquals(1, paths.size()); assertEquals(1, paths.get(0).get(0).getData()); }
public List<List<BinaryNode>> calculate(BinaryNode<Integer> root) { if (root == null) { throw new IllegalArgumentException("You can't pass a null instance of BinaryNode"); } return calculatePathToLeafs(root, new LinkedList<BinaryNode>()); }
PathToEveryLeaf { public List<List<BinaryNode>> calculate(BinaryNode<Integer> root) { if (root == null) { throw new IllegalArgumentException("You can't pass a null instance of BinaryNode"); } return calculatePathToLeafs(root, new LinkedList<BinaryNode>()); } }
PathToEveryLeaf { public List<List<BinaryNode>> calculate(BinaryNode<Integer> root) { if (root == null) { throw new IllegalArgumentException("You can't pass a null instance of BinaryNode"); } return calculatePathToLeafs(root, new LinkedList<BinaryNode>()); }  }
PathToEveryLeaf { public List<List<BinaryNode>> calculate(BinaryNode<Integer> root) { if (root == null) { throw new IllegalArgumentException("You can't pass a null instance of BinaryNode"); } return calculatePathToLeafs(root, new LinkedList<BinaryNode>()); }  List<List<BinaryNode>> calculate(BinaryNode<Integer> root); }
PathToEveryLeaf { public List<List<BinaryNode>> calculate(BinaryNode<Integer> root) { if (root == null) { throw new IllegalArgumentException("You can't pass a null instance of BinaryNode"); } return calculatePathToLeafs(root, new LinkedList<BinaryNode>()); }  List<List<BinaryNode>> calculate(BinaryNode<Integer> root);  }