Implemented and tested setForEach