Added random test for query segment trees.