If you have a complex private method that you think will benefit from unit testing, the general approach is to make this method private, so you can reference it directly from unit test. In your case, you can use the traversal private-private methods or create a private-getter method for root.
, unit test , , . , , . , , . , API- .
unit test , , . , API .