Welcome to the Ranch
You need some sophisticated technology: pencil paper and eraser. The latter is by far the most important
Write down exactly what you intend to do. Get it down to words of one syllable. For an example, this is how you can implement recursion
Do the same for the left branch of the tree from this place
. . .
And at this point you can do the same for the right branch of the tree
Once you have finished that, you will have pseudo-code which you can easily convert to code.
As you doubtless know, most of these trees do their sorting as the elements are inserted. to find whether you have an empty tree you can try the instanceof operator, but that will be unreliable if your empty class is a super class of a "full" tree class. you might end up
testingor something similar.