More test cases: With/without data modification, using lambdas, free functions, and functor struct