wrote tests for foldLeftViaFoldRight