Randomized tests validating tree structure