I have one weird problem about the following code. I write the code to search a tree.

```
public TreeNode<City> search(City parent, TreeNode<City> t){
    if (t.getCity().equals(parent)) {
        System.out.println("ccc");
        return t;
    }
    else if (t.hasLeftChild()){
        System.out.println("bbb");
        search(parent,t.getLeftChild());
    }
    else if(t.hasNextSibling()){
        System.out.println("aaa");
        search(parent,t.getNextSibling());
    }
    return null;
}

```

The odd thing is that: Assume there is only one element in my tree. Then, when I try to add an element to my tree, the method works properly. However, when there are two elements(a parent and a child) and I search for the child, what is printed on the screen is "ccc" and what the code returns is null!!!

I guess nobody has ever faced with that kind of stupid situation. Please help me!