Fix lengthOrZero 🌶️
The method below is supposed to return the length of the String s, or 0 if s is null. It throws an exception for one kind of input. Find the bug and fix it. Run the tests and read each result: a wrong value and an exception are different clues.
The result of the exception names the kind of mistake. What was s when the exception was thrown?
Test s == null first, and return 0 before calling length().