A new helper function added in random_test unit.