private void insertNode(TrinaryTreeNode<T> node, T value)   
    {         
        
    	int comparison = comparator.compare(value, node.getValue());
        if (comparison < 0)   
        {  
            //Left child exist  
            if (node.getLeft() != null)   
            {  
                insertNode(node.getLeft(), value);  
            }   
            // create the left child
            else   
            {  
                node.setLeft(new TrinaryTreeNode<T>(value, node));  
            }  
        }   
        else if (comparison > 0)   
        {  
            if (node.getRight() != null)   
            {  
                insertNode(node.getRight(), value);  
            }   
            // create the right child
            else   
            {  
                node.setRight(new TrinaryTreeNode<T>(value, node));  
            }  
        }  
        else  
        {  
            if (node.getMiddle() != null)   
            {  
                insertNode(node.getMiddle(), value);  
            }   
            // create the middle child
            else   
            {  
                node.setMiddle( new TrinaryTreeNode<T>(value, node));  
            }  
        }  
    }