Fix sumOddsUpTo 🌶️
The method below is supposed to return the sum of the odd numbers from 1 up to and including n, so sumOddsUpTo(9) is 1 + 3 + 5 + 7 + 9, which is 25. It leaves out the last odd number when n itself is odd. Find the bug and fix it. Run the tests and read each result: a wrong value, an exception and a loop that never ends are different clues.
Try n = 9 by hand. What values does i take, and does the loop run for i = 9?
The condition i < n stops BEFORE n. To include n when it is odd, use <=.