Q:

Is my Binary Tree adding nodes properly? 

I've just created a method to test the height of my binary tree implementation as follows:
public int height() {
    return height(rootNode);
}
private int height(BinaryTreeNode node) {
    if(node == null) return -1;
    else return 1 + Math.max(height(node.getLeftChild()), height(node.getRightChild()));
}

But it returns a height of 6, and not 7 when i add the nodes 1-6. 
Here is my Binary Tree code:
import java.util. ArrayList;
import java.util. Iterator;
import java.util. LinkedList;
import java.util. Queue;

public class BinaryTree<E extends Comparable<E>>
{
    private class BinaryTreeNode
    {
        private E value;
        private BinaryTreeNode leftChild, rightChild;

        public BinaryTreeNode(E value) {
            this(value, null, null);
        }

        public BinaryTreeNode(E value, BinaryTreeNode leftChild, BinaryTreeNode rightChild) {
            this.value = value;
            this.leftChild = leftChild;
            this.rightChild = rightChild;
        }

        public E getValue() {
            return value;
        }

        public BinaryTreeNode getLeftChild() {
            return leftChild;
        }

        public BinaryTreeNode getRightChild() {
            return rightChild;
        }

        public void setLeftChild(BinaryTreeNode newLeftChild) {
            this.leftChild = newLeftChild;
        }

        public void setRightChild(BinaryTreeNode newRightChild) {
            this.rightChild = newRightChild;
        }
    }

    private BinaryTreeNode rootNode;

    public BinaryTree() {
        this.rootNode = null;
    }

    public void addNode(E value) {
        if(rootNode == null)
            rootNode = new BinaryTreeNode(value);
        else
            addNode(value, rootNode);
    }

    //TODO: Implement removeNode()

    public void printLevelOrder() {
        printLevelOrder(rootNode);
    }

    public int height() {
        return height(rootNode);
    }

    public void inOrderTraversal() {
        if(rootNode ! = null) inOrderTraversal(rootNode);
        else System.out.println("The tree is empty!"); 
    }

     private void addNode(E value, BinaryTreeNode node) {
        if(node.getValue().compareTo(value) > 0) {
            if(node.getLeftChild() ! = null)
                addNode(value, node.getLeftChild());
            else
                node.setLeftChild(new BinaryTreeNode(value));
        } else {
            if(node.getRightChild() ! = null)
                addNode(value, node.getRightChild());
            else
                node.setRightChild(new BinaryTreeNode(value));
        }
    }

    private void printLevelOrder(BinaryTreeNode node) {
        Queue<BinaryTreeNode> currentLevel = new LinkedList<BinaryTreeNode>();
        Queue<BinaryTreeNode> nextLevel = new LinkedList<BinaryTreeNode>();

        currentLevel.add(node);

        while (! currentLevel.isEmpty()) {
            Iterator<BinaryTreeNode> iter = currentLevel.iterator();
            while (iter.hasNext()) {
                BinaryTreeNode currentNode = iter.next();
                if (currentNode.leftChild ! = null) {
                    nextLevel.add(currentNode.leftChild);
                }
                if (currentNode.rightChild ! = null) {
                    nextLevel.add(currentNode.rightChild);
                }
                System.out.print(currentNode.value + " ");
            }
            System.out.println();
            currentLevel = nextLevel;
            nextLevel = new LinkedList<BinaryTreeNode>();

        }
    }

    private int height(BinaryTreeNode node) {
        if(node == null) return -1;
        else return 1 + Math.max(height(node.getLeftChild()), height(node.getRightChild()));
    }

    private void inOrderTraversal(BinaryTreeNode node) {
        if(node ! = null) {
            inOrderTraversal(node.leftChild);
            System.out.println(node.getValue() + " ");
            inOrderTraversal(node.getRightChild());
        }
    }

    public BinaryTreeNode getRoot() {
        return rootNode;
    }
}

I think the problem is adding my node into the tree, but I've taken a look at other examples but they all seem to be doing the same thing I am.. So i can't realise the problem! 
Thanks! 

A:

private int height(BinaryTreeNode node) {
if(node == null) return 0;
else return 1 + Math.max(height(node.getLeftChild()), height(node.getRightChild()));

}
You were returning -1 on node==null when you should return 0.   
The condition is true when we arrive to leaf so for example if we add 1-2 then we have height as 1+Max(leftof(1),rightof(1))=
1+Max(height(null),height(2))=
1+Max(0,1+Max(leftof(2),rightof(2)))=
1+Max(0,1+Max(height(null),height(null)))=
1+Max(0,1+Max(0,0))=
1+Max(0,1+0)=
1+1=2.   
Try to replace height(null) with -1 in the previous example to see by yourself. 
By the way your BinaryTree implementation is actually a binary search tree since you're putting less elements on the left and bigger elements on the right, If a search tree is your intention then Ok but if you want to implement a general binary tree then you should change the add function.