title: TreeViolationException problem
body: <p>Hi Im having some trouble when inserting to the right of a node in a binary tree... I just dont see why the exception is happening.  This is the method to inset:</p>
  
  <pre><code>public void attachRight(BinaryTree&lt;T&gt; tree) {
      if (right != null) {
          throw new TreeViolationException();
  
      }
      if (tree != null) {
          tree.parent = this;
          right = tree;
      }
  }
  </code></pre>
  
  <p>This is the code in my main class</p>
  
  <p>public class Testing {</p>
  
  <pre><code>public static void main(String[] args) {
  
      /*  the tree to be built                30
       *                                    /    \
       *                                  12     16
       *                                 /  \   /  \
       *                               null  1  2   5
       */
  
      //Create binary tree and set root to 30
      BinaryTree&lt;Integer&gt; root = new BinaryTree&lt;Integer&gt;();
      root.makeRoot(30);
      //System.out.println(root.getData()); //for verifying only
  
      //Insert 12 -&gt; left(30)
      root.attachLeft(new BinaryTree&lt;Integer&gt;());
      root.left.setData(12);
  
      //Insert 16 -&gt; right(30)
      root.attachRight(new BinaryTree&lt;Integer&gt;());
      root.right.setData(16);
  
      //insert 1 -&gt; right(12)
      root.right.attachRight(new BinaryTree&lt;Integer&gt;());
      root.right.right.setData(1);
  
      //insert 2 -&gt; left(16)
      root.right.attachLeft(new BinaryTree&lt;Integer&gt;());
      root.right.left.setData(2);
  
      //insert 5 -&gt; right(16)
      root.right.attachRight(new BinaryTree&lt;Integer&gt;());
      root.right.right.setData(5);
  
      System.out.println(root.getData());
      System.out.println(root.left.getData());
      System.out.println(root.right.getData());
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I'm only able to insert, 30, 12, and 16.  Not sure what's going on....
  This is the error I get, it happens in the attachRight method</p>
  
  <p>Exception in thread "main" proj5.TreeViolationException
      at proj5.BinaryTree.attachRight(BinaryTree.java:98)</p>
  
  <p>TreeViolationException is just a class that I have that extends RuntimeException</p>