title: Java Binary Tree. Printing InOrder traversal
body: <p>I am having some problems printing an inOrder traversal of my binary tree. Even after inserting many items into the tree it's only printing 3 items.</p>
  
  <pre><code>public class BinaryTree {
  
      private TreeNode root;
      private int size;
  
      public BinaryTree(){
          this.size = 0;
      }
  
      public boolean insert(TreeNode node){
  
          if( root == null)
              root = node;
  
          else{
              TreeNode parent = null;
              TreeNode current = root;
              while( current != null){
                  if( node.getData().getValue().compareTo(current.getData().getValue()) &lt;0){
                      parent = current;
                      current = current.getLeft();
                  }
                  else if( node.getData().getValue().compareTo(current.getData().getValue()) &gt;0){
                      parent = current;
                      current = current.getRight();
                  }
                  else
                      return false;
  
                  if(node.getData().getValue().compareTo(parent.getData().getValue()) &lt; 0)
                      parent.setLeft(node);
                  else
                      parent.setRight(node);
                  }
              }
              size++;
              return true;
          }
  
  
      /**
       * 
       */
      public void inOrder(){
          inOrder(root);
      }
  
      private void inOrder(TreeNode root){
          if( root.getLeft() !=null)
              this.inOrder(root.getLeft());
          System.out.println(root.getData().getValue());
  
          if( root.getRight() != null)
              this.inOrder(root.getRight());
      }
  
  
  
  }
  </code></pre>