Added test for flattenPreREnder.