Why is false being returned in this function
<p>I have this function below which makes it to the second IF function which sets the variable <code>th</code> as true but what is returned is false? Why?!</p>

<pre><code>public boolean nodeExist(TreeNode Tree, T value){

    boolean th = false;

    if(Tree.getValue()!= null){

        if(value == Tree.getValue()){

            th = true;

        }else{

            if(value.compareTo((T) Tree.getValue()) &lt; 0){

                nodeExist(Tree.getLeft(), value);

            }else{

                nodeExist(Tree.getRight(), value);
            }

        }

    }else{

        th = false;

    }

    return th;

}
</code></pre>
