ternary tree test