Add test coverage for foreach* methods