@Test public void shouldCalculateBinaryTreeDepthEvenIfTreeContainsJustOneBigLeftBranch() { BinaryNode<Integer> root = new BinaryNode<Integer>(0); BinaryNode<Integer> n1 = new BinaryNode<Integer>(1); BinaryNode<Integer> n2 = new BinaryNode<Integer>(2); root.setLeft(n1); n1.setLeft(n2); int depth = binaryTreeDepth.get(root); assertEquals(3, depth); }
public int get(BinaryNode root) { if (root == null) { throw new IllegalArgumentException("You can't pass a null BinaryNode as parameter"); } return getInner(root); }
BinaryTreeDepth { public int get(BinaryNode root) { if (root == null) { throw new IllegalArgumentException("You can't pass a null BinaryNode as parameter"); } return getInner(root); } }
BinaryTreeDepth { public int get(BinaryNode root) { if (root == null) { throw new IllegalArgumentException("You can't pass a null BinaryNode as parameter"); } return getInner(root); }  }
BinaryTreeDepth { public int get(BinaryNode root) { if (root == null) { throw new IllegalArgumentException("You can't pass a null BinaryNode as parameter"); } return getInner(root); }  int get(BinaryNode root); }
BinaryTreeDepth { public int get(BinaryNode root) { if (root == null) { throw new IllegalArgumentException("You can't pass a null BinaryNode as parameter"); } return getInner(root); }  int get(BinaryNode root);  }