variation without mutating array, define_method in tests